From 38552103cc149276a12a9d85f4460c307974e6c7 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 25 May 2018 15:21:01 +0200 Subject: [PATCH] HHH-12634 Make EntityPrinter more permissive regarding the parameters passed --- .../main/java/org/hibernate/internal/util/EntityPrinter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }