File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure 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
  • 0
  • 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
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic