Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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

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
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!