JPA 2.0 Eclipse Link ... Composite primary keys

Posted by Parhs on Stack Overflow See other posts from Stack Overflow or by Parhs
Published on 2010-03-16T09:03:13Z Indexed on 2010/03/16 9:06 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I have two entities(actually more but it doenst matter)

Exam and Exam_Normals

Its a oneToMany relationship... The problem is that i need a primary key for Exams_Normals PK (Exam_ID Item) Item should be 1 2 3 4 5 etc.... But cant achieve it getting errors

An alternative would be to: I cound use an IDENTITY and a ManyToOne relationship at Exam_Normals but that should be like PK(Exam_Normals_ID) and a reference to Exam and an extra collumn Item to keep an order.. SO 3 collumns

But to avoid the alternative tried I tried with @IdClass and got errors Tried @EmbeddedID everything nothing works

Any idea??

© Stack Overflow or respective owner

Related posts about composite

Related posts about primary