IntelliJ Java IDE
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
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "[hibernate] OneToOne add a new child  :o(" Watch "[hibernate] OneToOne add a new child  :o(" New topic
Author

[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(
 
Threads others viewed
one to one unidirectional mapping in jpa
OneToOne persisting two objects in a single transaction
Problem at insert with relationship JPA 2.0
how to update OneToMany
@PrimaryKeyJoinColumn with bidirectional @OneToOne relationship and @Id
IntelliJ Java IDE