Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-one persistence with existing child object  RSS feed

 
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
Boost this thread!