-->
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.  [ 2 posts ] 
Author Message
 Post subject: link table with multiple foreign keys. How?
PostPosted: Thu Jan 05, 2006 4:22 pm 
Newbie

Joined: Thu Jan 05, 2006 4:09 pm
Posts: 1
I have been searching for an answer to this question for some time and I must be missing something. In SQL it is painfully obvious, but I cannot figure out how to do this with hibernate.

Table A contains a primary key a_id
Table B contains a primary key b_id
Table C contains a primary key c_id

Table D is my link table with foreign keys back to the above tables. Coming into the application I know the primary key for A and for B.

How do I construct C?

In SQL it's select c_id from C where a_id = ? and b_id = ?

I am trying to refrain from using pure SQL if I can avoid it. If someone can point me in the right direction that would be great!

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 4:38 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you must make hql similar your sql - your caes is very specific


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

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.