Class DefaultDirtyCheckEventListener

java.lang.Object
org.hibernate.event.internal.DefaultDirtyCheckEventListener
All Implemented Interfaces:
DirtyCheckEventListener

public class DefaultDirtyCheckEventListener extends Object implements DirtyCheckEventListener
Determines if the current session holds modified state which would be synchronized with the database if the session were flushed. Approximately reproduces the logic that is executed on an AutoFlushEvent.
Implementation Note:
Historically, Session.isDirty() was implemented to actually execute a partial flush and then return true if there were any resulting operations to be executed. This was extremely inefficient and side-effecty. The new implementation below is non-perfect and probably misses some subtleties, but it's I guess OK to view it as an approximation.