Fix for TuplizerDynamicEntityTest and ImprovedTuplizerDynamicEntityTest

This commit is contained in:
Andrea Boriero 2016-04-26 23:50:59 +01:00 committed by Steve Ebersole
parent 16b0b74bd2
commit d9ac176989
1 changed files with 1 additions and 1 deletions

View File

@ -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() );