Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-one persistence with existing child object

 
moaad elamrani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

if I have entity parent containing a foreign key to entity child (with Eager fetching).
If say I fetch an existing child from the database, and set it as the child of a parent instance.
When I save the parent, will hibernate try to override the existing child or instead try to find existing one and create the foreign key link?

Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic