-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How I can Right outer join via java?
PostPosted: Fri Aug 28, 2009 9:25 am 
Newbie

Joined: Fri Aug 28, 2009 8:42 am
Posts: 1
In class CriteriaSpecification I see only LEFT_JOIN definition, where is RIGHT_JOIN?

I need to build such subquery (in Oracle 9 notation):
... and some_column in (
SELECT Child.ID
FROM Child, Parent
WHERE Child.ParentID (+)= Parent.ID
)
Parent class does not know nothing about joined childs, but Child class does.
So, when I write
final DetachedCriteria subCrit = DetachedCriteria.forClass(Child.class);
subCrit.createAlias("parent", "parent", CriteriaSpecification.LEFT_JOIN);
will produce
... WHERE Child.ParentID = Parent.ID(+)

I can't to write
final DetachedCriteria subCrit = DetachedCriteria.forClass(Parent.class);
subCrit.createAlias("child", "child", CriteriaSpecification.LEFT_JOIN);

because parent doesn't have property for "child".

Really I need to more complex subquery like:
SELECT Child.ID
FROM Child, Parent
WHERE Child.ParentID (+)= Parent.ID
and Child.ID is not null
CONNECT BY PRIOR Parent.ID = Parent.ParentID
START WITH Parent.ID = ?

because parents is tree and not each node of tree have joined child.
------

Eugene.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.