Further to my last response; If I add my own join statement "ON child.parentContentTreeId = parent.contentTreeId" it throws this error "The property 'parentTreeId' could not be found in the object 'Tree"
Cheers Matthew On Aug 18, 10:41 am, Matthew <matthewbchamb...@gmail.com> wrote: > Hi Mark > > You were right. It is joining both ways. The 2nd part of the join > shouldn't be there. > > SELECT child.treeId > FROM Tree child > INNER JOIN Tree parent ON child.parentTreeId = parent.treeId AND > child.treeId = parent.parentTreeId > WHERE child.urlString = ? > AND parent.urlString = ? > > Cheers > Matthew > > On Aug 18, 10:15 am, Mark Mandel <mark.man...@gmail.com> wrote: > > > The SQL show up in ColdFusion debugging. > > > Mark > > > On Tue, Aug 18, 2009 at 10:12 AM, Matthew <matthewbchamb...@gmail.com>wrote: > > > > Hi Mark > > > > I'm not sure how to obtain the SQL because option 1 returns an empty > > > object and option 2 returns this "Message: The property that was > > > searched for could not be found. Detail: The property > > > 'ParentContentTree.urlString' could not be found in the object > > > 'ContentTree'" > > > > Cheers > > > Matthew > > > > On Aug 18, 10:02 am, Mark Mandel <mark.man...@gmail.com> wrote: > > > > What is the SQL generated on this? > > > > > You may need to specify which join you want to use as it is quite likely > > > > auotjoining both to each other. > > > > > Mark > > > > > On Tue, Aug 18, 2009 at 10:00 AM, Matthew <matthewbchamb...@gmail.com > > > >wrote: > > > > > > *** CFM option 2 *** > > > > > query = getTransfer().createQuery("FROM Tree AS child JOIN Tree AS > > > > > parent WHERE child.urlString = :urlString AND parent.urlString > > > > > = :parentUrlString"); > > > > > query.setParam("urlString",Arguments.urlString,"string"); > > > > > query.setParam("parentUrlString",Arguments.parentUrlString,"string"); > > > > > oTreeItem = getTransfer().readByQuery("Tree",query); > > > > > $ It doesn't throw an error it just returns an empty object (probably > > > > > because the join isn't working properly). If I keep the join but > > > > > remove the AND condition it doesn't work either. If I take out the > > > > > "parent" join as well as the AND condition it works i.e. by only > > > > > retrieving based on a <property> value. > > > > > -- > > > > E: mark.man...@gmail.com > > > > T:http://www.twitter.com/neurotic > > > > W:www.compoundtheory.com > > > -- > > E: mark.man...@gmail.com > > T:http://www.twitter.com/neurotic > > W:www.compoundtheory.com --~--~---------~--~----~------------~-------~--~----~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---