-->
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: Single Criteria for transitive dependency
PostPosted: Mon Mar 07, 2011 6:54 am 
Newbie

Joined: Mon Mar 07, 2011 6:32 am
Posts: 3
TableA
A_id primarykey
A_field

TableB
B_id primarykey
A_id
B_field

TableC
C_id primarykey
B_id
C_field

There is many to 1 relationship from Table A to Table B
Similary, there is many to 1 relationship from Table B to Table C

Say if I want to retrieve C_field using A_id, how can I do that using a single Criteria statement?

Corresponsing MySQL statement: SELECT c.C_field FROM TableC c JOIN TableB b ON c.B_id = b.B_id JOIN TableA a on b.A_id = a.A_id

Many thanks
Sony G


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.