This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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....
jQuery in Action, 2nd edition
subject: [hibernate] OneToOne add a new child :o(
Similar Threads
OneToOne persisting two objects in a single transaction
Problem at insert with relationship JPA 2.0
@PrimaryKeyJoinColumn with bidirectional @OneToOne relationship and @Id
how to update OneToMany
one to one unidirectional mapping in jpa