• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-one persistence with existing child object

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

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?

my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!