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: Urgent: Please help with Collection/Native SQL
PostPosted: Wed Oct 10, 2007 10:11 am 
Newbie

Joined: Sun Oct 07, 2007 6:37 pm
Posts: 3
I have the following table structure that I am trying to map using hibernate

Table A {
a_id
b_id1
a_col1
a_col2

}

Table B {
b_id1
b_id2
b_col1
b_col2
}
Table A has a single col primary key where as B has a composite key with 2 columns.
Now I am trying to map these 2 tables where each row in A has multiple rows in B. However, as you see above, table A has a partial key from table B

I created a class A with a list to map to the rows in B but then when I specify the key as 2 columns from B, Hibernate complains that the key for the list should be the same number as for table A. When i try with only a single column b_id1 from A, I don't get all the unique data!

Could someone let me know how to map it in Hibernate and possible get data from these 2 tables in a single query?

Thanks so much

SG


Thanks,
Sri


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.