HHH-7359 Corrected trace logging of HibernateProxy objects

This commit is contained in:
brmeyer 2012-10-24 16:05:33 -04:00
parent 757c18bf73
commit 06463d169c
1 changed files with 3 additions and 0 deletions

View File

@ -505,6 +505,9 @@ public abstract class EntityType extends AbstractType implements AssociationType
throw new ClassCastException( value.getClass().getName() );
}
id = ( Serializable ) value;
} else if ( value instanceof HibernateProxy ) {
HibernateProxy proxy = ( HibernateProxy ) value;
id = proxy.getHibernateLazyInitializer().getIdentifier();
}
else {
id = persister.getIdentifier( value );