POJOs for Composite Primary Key from Foreign Key

Posted by Gaurav on Stack Overflow See other posts from Stack Overflow or by Gaurav
Published on 2010-05-13T08:06:17Z Indexed on 2010/05/13 8:14 UTC
Read the original article Hit count: 606

hi, I have table in database that has only two columns and these two colums are FK references. they have made these two colums as composite primarykey.

table structure

Table A
[
A_id PK
Description
]

Table B
[
B_Id PK
Description
]

Table A_B_Pemissiom
[
A_id (FK table A)
B_Id (FK table B)
PrimaryKey ( A_id,B_Id )
]

Can anyone help , I tried several ways and none of them works. Can anyone tell a working Hibernate mapping solution using annotations ?

Thanks,
Gaurav

© Stack Overflow or respective owner

Related posts about composite-key

Related posts about nhibernate