From 70a7c7a8210cc8e67043a3cce5ecf57b72d894f2 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 24 Feb 2014 16:47:29 +0000 Subject: [PATCH] HHH-8984 EntityEntry slimming: remove EntityMode and tenantId fields --- .../internal/StatefulPersistenceContext.java | 2 -- .../java/org/hibernate/engine/spi/EntityEntry.java | 14 -------------- .../test/bytecode/enhancement/EnhancerTest.java | 2 -- .../enhancement/customer/CustomerEnhancerTest.java | 2 -- 4 files changed, 20 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java index c6672ffb3c..6d7a1a89af 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java @@ -503,8 +503,6 @@ public class StatefulPersistenceContext implements PersistenceContext { lockMode, existsInDatabase, persister, - persister.getEntityMode(), - session.getTenantIdentifier(), disableVersionIncrement, lazyPropertiesAreUnfetched, this diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/EntityEntry.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/EntityEntry.java index 9b24418bb3..45b7c539df 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/EntityEntry.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/EntityEntry.java @@ -53,8 +53,6 @@ public final class EntityEntry implements Serializable { private boolean existsInDatabase; private Object version; private transient EntityPersister persister; - private final EntityMode entityMode; - private final String tenantId; private final String entityName; // cached EntityKey (lazy-initialized) private transient EntityKey cachedEntityKey; @@ -73,8 +71,6 @@ public final class EntityEntry implements Serializable { final LockMode lockMode, final boolean existsInDatabase, final EntityPersister persister, - final EntityMode entityMode, - final String tenantId, final boolean disableVersionIncrement, final boolean lazyPropertiesAreUnfetched, final PersistenceContext persistenceContext) { @@ -92,8 +88,6 @@ public final class EntityEntry implements Serializable { this.isBeingReplicated=disableVersionIncrement; this.loadedWithLazyPropertiesUnfetched = lazyPropertiesAreUnfetched; this.persister=persister; - this.entityMode = entityMode; - this.tenantId = tenantId; this.entityName = persister == null ? null : persister.getEntityName(); this.persistenceContext = persistenceContext; } @@ -106,8 +100,6 @@ public final class EntityEntry implements Serializable { final SessionFactoryImplementor factory, final String entityName, final Serializable id, - final EntityMode entityMode, - final String tenantId, final Status status, final Status previousStatus, final Object[] loadedState, @@ -121,8 +113,6 @@ public final class EntityEntry implements Serializable { this.entityName = entityName; this.persister = ( factory == null ? null : factory.getEntityPersister( entityName ) ); this.id = id; - this.entityMode = entityMode; - this.tenantId = tenantId; this.status = status; this.previousStatus = previousStatus; this.loadedState = loadedState; @@ -410,8 +400,6 @@ public final class EntityEntry implements Serializable { public void serialize(ObjectOutputStream oos) throws IOException { oos.writeObject( entityName ); oos.writeObject( id ); - oos.writeObject( entityMode.toString() ); - oos.writeObject( tenantId ); oos.writeObject( status.name() ); oos.writeObject( (previousStatus == null ? "" : previousStatus.name()) ); // todo : potentially look at optimizing these two arrays @@ -445,8 +433,6 @@ public final class EntityEntry implements Serializable { persistenceContext.getSession().getFactory(), (String) ois.readObject(), (Serializable) ois.readObject(), - EntityMode.parse( (String) ois.readObject() ), - (String) ois.readObject(), Status.valueOf( (String) ois.readObject() ), ( previousStatusString = (String) ois.readObject() ).length() == 0 ? null diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/EnhancerTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/EnhancerTest.java index 15f84e0fdd..bc68956627 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/EnhancerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/EnhancerTest.java @@ -304,8 +304,6 @@ public class EnhancerTest extends BaseUnitTestCase { LockMode.NONE, false, null, - EntityMode.POJO, - null, false, false, null diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/customer/CustomerEnhancerTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/customer/CustomerEnhancerTest.java index 122bd5eeea..f2dd994132 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/customer/CustomerEnhancerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/customer/CustomerEnhancerTest.java @@ -263,8 +263,6 @@ public class CustomerEnhancerTest extends BaseUnitTestCase { LockMode.NONE, false, null, - EntityMode.POJO, - null, false, false, null