Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Object Relational Mapping and the fly likes [hibernate] OneToOne add a new child  :o( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[hibernate] OneToOne add a new child  :o(" Watch "[hibernate] OneToOne add a new child  :o(" New topic

[hibernate] OneToOne add a new child :o(

Alessandro Ilardo
Ranch Hand

Joined: Dec 23, 2005
Posts: 218
Hi there,
I'm new with persistence, and I'm having a problem updating an object which has a chlid object referenced by a OneToOne relation.
When I update the child properties a new row is added into the table, while I'd like just udpate the existing one.

The father

the child

On my session bean I call the merge method on the user instance.
Any suggestions?

Thanks in advance

trying to decode a woman mind....
subject: [hibernate] OneToOne add a new child :o(
jQuery in Action, 3rd edition