From d9ac176989f0562700666b18f1778318a6a89992 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Tue, 26 Apr 2016 23:50:59 +0100 Subject: [PATCH] Fix for TuplizerDynamicEntityTest and ImprovedTuplizerDynamicEntityTest --- .../src/main/java/org/hibernate/internal/SessionImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 0f0762e7ad..24d779105a 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -1887,7 +1887,7 @@ public final class SessionImpl checkOpen(); // checkTransactionSynchStatus(); - if ( object != null && !HibernateProxy.class.isInstance( object ) ) { + if ( object != null && !HibernateProxy.class.isInstance( object ) && persistenceContext.getEntry( object ) == null ) { // check if it is an entity -> if not throw an exception (per JPA) try { getSessionFactory().getMetamodel().entityPersister( object.getClass() );