pearl8 wrote:
My question is: How did Hibernate know that the address object had the line1 modified?
How does Hibernate detect this in one-one associations? Does it use Proxies? Or does it use a brute-force method to check all one-one associations?
It's depend on your code. If object in question is not associated with the session at the time when the flushing occured, then dirty checking is not performed. If dirty checking is performed, then it cascades to associations with cascading style "save-update" or "all"
Particular operations (save/update etc.) usualy do not perform dirty checking of objects - they simple do cascading to appropriate associations.
Method, used for dirty checking is depends on your settings - usually this is snapshot comparision for values of properties, and special proxy implementations for collections.