Author: steve.ebersole(a)jboss.com
Date: 2006-11-15 14:47:22 -0500 (Wed, 15 Nov 2006)
New Revision: 10816
Modified:
trunk/Hibernate3/src/org/hibernate/type/SerializableType.java
Log:
minor change to how SerializableType determines dirtiness
Modified: trunk/Hibernate3/src/org/hibernate/type/SerializableType.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/type/SerializableType.java 2006-11-15 15:27:54 UTC
(rev 10815)
+++ trunk/Hibernate3/src/org/hibernate/type/SerializableType.java 2006-11-15 19:47:22 UTC
(rev 10816)
@@ -50,6 +50,16 @@
return Hibernate.BINARY.isEqual( toBytes(x), toBytes(y) );
}
+ public boolean isDirty(Object old, Object current, SessionImplementor session) throws
HibernateException {
+ if ( old == current ) {
+ return true;
+ }
+ if ( old == null || current == null ) {
+ return false;
+ }
+ return old.equals( current ) || Hibernate.BINARY.isEqual( toBytes( old ), toBytes(
current ) );
+ }
+
public int getHashCode(Object x, EntityMode entityMode) {
return Hibernate.BINARY.getHashCode( toBytes(x), entityMode );
}