• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can i mark a Set/Collection porpety as @Id

 
Charan kumar sarvepalli
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we normal mark property as @id when we need to make it as PK.

i have total 3 class A,B and C

A has 1-1 association with B
A has 1-many association with C

but in B and C does not have Pk's, they have only FK.
As per hibernate we need to mention atleast one column as @id property, so i designed my classes to have @id on FK property.

is the above code is right..? or design should be changed ..? any suggestions..

Thanks in Advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic