diff --git a/hibernate-core/src/main/java/org/hibernate/type/ManyToOneType.java b/hibernate-core/src/main/java/org/hibernate/type/ManyToOneType.java index 253dd049aa..3344aa31cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ManyToOneType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ManyToOneType.java @@ -227,9 +227,8 @@ public class ManyToOneType extends EntityType { return true; } // the ids are fully resolved, so compare them with isDirty(), not isModified() - Object oldid = getIdentifier( old, session ); - Object newid = getIdentifier( current, session ); - return getIdentifierOrUniqueKeyType( session.getFactory() ).isDirty( oldid, newid, session ); + return getIdentifierOrUniqueKeyType( session.getFactory() ) + .isDirty( old, getIdentifier( current, session ), session ); } public Serializable disassemble(