This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Issues with @PrimaryKeyJoinColumn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Issues with @PrimaryKeyJoinColumn" Watch "Issues with @PrimaryKeyJoinColumn" New topic
Author

Issues with @PrimaryKeyJoinColumn

anagha desai
Greenhorn

Joined: May 08, 2008
Posts: 22
Facing issues with the above annotation .

Reading "Mannings in action book for ejb3 " and trying out a few examples

This is a Master Child relation with Child containing the FK
The FK in Child is also the PK for that Table

So from my understanding we need to use :: @PrimaryKeyJoinColumn

However I get the following exception ::


Thanks ,
-anagha
Ramdas Sawant
Ranch Hand

Joined: Aug 08, 2005
Posts: 51
Faced this issue in last week while reading the same book.. figured out how to do this... giving the full sample code for mapping



Important point to note the usage of "GenericGenerator". Just google for this if you need more info. Hope this helps. Thanks

regards,
Ramdas


If you think you can, you can. If you think you can't, you are right.
subhanair girish
Greenhorn

Joined: Aug 12, 2008
Posts: 13
please help me with the hibernate one to one mapping.
partnerform(identification_no,verification_no)
loginform(user_id,username,password,identification_no)

user_id = PK of loginform
identification_no = PK of partnerform, FK of loginform





the exceptions listng
Aram Nigiyan
Greenhorn

Joined: Mar 23, 2010
Posts: 1
thanks, Ramdas Sawant, working example you posted helped me very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues with @PrimaryKeyJoinColumn