If you load an entity from db and modify it somehow, will hibernate use equals/hashCode to compare current state of entity with it’s snapshot to determine if sql update needs to be performed?
If it does such comprasions, I have another question: if equals will return true, will hibernate think that entity did not changed or attempt to use it’s default comprasion (to be sure)?
Please see Equals and HashCode from the JBoss Community website. From there:
In other words, Hibernate uses equals and hashCode for identity, not to see if an object has been modified. It uses attribute by attribute comparisons for that.