diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/EntityPrinter.java b/hibernate-core/src/main/java/org/hibernate/internal/util/EntityPrinter.java index acb222fbc1..f4ac35f059 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/EntityPrinter.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/EntityPrinter.java @@ -40,7 +40,7 @@ public final class EntityPrinter { public String toString(String entityName, Object entity) throws HibernateException { EntityPersister entityPersister = factory.getEntityPersister( entityName ); - if ( entityPersister == null ) { + if ( entityPersister == null || !entityPersister.isInstance( entity ) ) { return entity.getClass().getName(); }