diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/EntityJavaType.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/EntityJavaType.java index 6571b92efb..a5c7e67605 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/EntityJavaType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/EntityJavaType.java @@ -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 extends AbstractClassJavaType { return one == another; } + @Override + public boolean isInstance(Object value) { + return getJavaTypeClass().isAssignableFrom( Hibernate.getClassLazy( value ) ); + } + @Override public String toString(T value) { return value.toString();