This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Save Or Update question

 
satya devarapalli
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say I have an ORM which has several child instances. If there is change in only one of the fields in the child instance and I do a save or update on the parent ORM, will it just save the instance that has the change?

I would like to know if there is any performance issue doing a save on the parent ORM since it has several other child instances. I could do a save just on the Child instance that will change but I want to keep my code generic.
 
Anindya Roy
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it with hibernate inheritance.

You can find an example http://www.sblog.in/2014-03-08-02-28-32/hibernate/35-inheritance-strategy-in-hibernate
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!