HHH-17467 Handle proxies when checking entity type instance

This commit is contained in:
Marco Belladelli 2023-11-29 14:08:38 +01:00 committed by Christian Beikov
parent 74066a7afe
commit e8d436ffb2
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.type.descriptor.java.spi;
import org.hibernate.Hibernate;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractClassJavaType;
import org.hibernate.type.descriptor.java.IncomparableComparator;
@ -41,6 +42,11 @@ public class EntityJavaType<T> extends AbstractClassJavaType<T> {
return one == another;
}
@Override
public boolean isInstance(Object value) {
return getJavaTypeClass().isAssignableFrom( Hibernate.getClassLazy( value ) );
}
@Override
public String toString(T value) {
return value.toString();