aspose file tools*
The moose likes Object Relational Mapping and the fly likes can i mark a Set/Collection porpety as @Id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "can i mark a Set/Collection porpety as @Id" Watch "can i mark a Set/Collection porpety as @Id" New topic
Author

can i mark a Set/Collection porpety as @Id

Charan kumar sarvepalli
Ranch Hand

Joined: Dec 14, 2008
Posts: 40
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


-- Charan
 
Don't get me started about those stupid light bulbs.
 
subject: can i mark a Set/Collection porpety as @Id