Author: steve.ebersole(a)jboss.com
Date: 2006-11-15 14:47:44 -0500 (Wed, 15 Nov 2006)
New Revision: 10817
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/type/SerializableType.java
Log:
minor change to how SerializableType determines dirtiness
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/type/SerializableType.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/type/SerializableType.java 2006-11-15
19:47:22 UTC (rev 10816)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/type/SerializableType.java 2006-11-15
19:47:44 UTC (rev 10817)
@@ -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 );
}