Imagine that you have two objects, say Person and Event from the documentation. A person can have multiple event objects. Now imagine, that I have saved a person object which has twelve event objects associated with it.
If I make a change to the person object, but not to any of the events, and tell Hibernate to save the person object will it also make an update call for each of the twelve events?
If I make a change to the fourth event object in the person's list of twelve and then tell Hibernate to save the person will twelve update calls be made or just one?
If I retrieve the person object but never attempt to retrieve the person's events did any of the events get pulled from the database and placed into memory?
I'm curious how Hibernate deals with these sorts of optimization problems, any insight would be appreciated.
Thanks!
|