-->
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: Specifying join conditions using criteria
PostPosted: Mon Apr 16, 2012 2:24 am 
Newbie

Joined: Mon Apr 16, 2012 2:21 am
Posts: 1
Hi,
I want to perform a "left outer join" on two tables, specifying join conditions.

Ex:
TableA(col1A, col2A)
TableB(col1B, col2B)

select * from TableA ta left outer join TableB tb on (ta.col1A=tb.col1B and ta.col2A=tb.col2B);

Any idea, how can I achieve the same using hibernate criteria.

Using this, it is doing left outer join on the foreign/primary keys..

session.createCriteria(TableA.class, “tableAAlias”)
criteria.createAlias(TableB, “tableBAlias”, Criteria.LEFT_JOIN);

I didn’t find any way to add join conditions..

--
Thank you,
B. Palvali Teja.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.