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
|