diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java index 815eaa3808..a0caaf251f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java @@ -56,8 +56,6 @@ import org.hibernate.boot.spi.InFlightMetadataCollector; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.boot.spi.NaturalIdUniqueKeyBinder; -import org.hibernate.cache.cfg.internal.DomainDataRegionConfigImpl.Builder; -import org.hibernate.cache.spi.access.AccessType; import org.hibernate.cfg.AnnotatedClassType; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.CopyIdentifierComponentSecondPass; @@ -147,8 +145,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector private final Map fetchProfileMap = new HashMap<>(); private final Map idGeneratorDefinitionMap = new HashMap<>(); - private final Map regionConfigBuilders = new ConcurrentHashMap<>(); - private Map sqlFunctionMap; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -297,27 +293,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector throw new DuplicateMappingException( DuplicateMappingException.Type.ENTITY, entityName ); } entityBindingMap.put( entityName, persistentClass ); - - final AccessType accessType = AccessType.fromExternalName( persistentClass.getCacheConcurrencyStrategy() ); - if ( accessType != null ) { - if ( persistentClass.isCached() ) { - locateCacheRegionConfigBuilder( persistentClass.getRootClass().getCacheRegionName() ).addEntityConfig( - persistentClass, - accessType - ); - } - - if ( persistentClass.hasNaturalId() && persistentClass instanceof RootClass && persistentClass.getNaturalIdCacheRegionName() != null ) { - locateCacheRegionConfigBuilder( persistentClass.getNaturalIdCacheRegionName() ).addNaturalIdConfig( - (RootClass) persistentClass, - accessType - ); - } - } - } - - private Builder locateCacheRegionConfigBuilder(String regionName) { - return regionConfigBuilders.computeIfAbsent( regionName, Builder::new ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -340,14 +315,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector throw new DuplicateMappingException( DuplicateMappingException.Type.COLLECTION, collectionRole ); } collectionBindingMap.put( collectionRole, collection ); - - final AccessType accessType = AccessType.fromExternalName( collection.getCacheConcurrencyStrategy() ); - if ( accessType != null ) { - locateCacheRegionConfigBuilder( collection.getCacheRegionName() ).addCollectionConfig( - collection, - accessType - ); - } } @@ -2260,7 +2227,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector sqlResultSetMappingMap, namedEntityGraphMap, sqlFunctionMap, - regionConfigBuilders.values(), getDatabase(), bootstrapContext ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java index 8a793f6649..85f78d01f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java @@ -29,7 +29,6 @@ import org.hibernate.boot.spi.BootstrapContext; import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.boot.spi.SessionFactoryBuilderFactory; -import org.hibernate.cache.cfg.internal.DomainDataRegionConfigImpl; import org.hibernate.cfg.annotations.NamedEntityGraphDefinition; import org.hibernate.cfg.annotations.NamedProcedureCallDefinition; import org.hibernate.dialect.function.SQLFunction; @@ -80,7 +79,6 @@ public class MetadataImpl implements MetadataImplementor, Serializable { private final Map sqlResultSetMappingMap; private final Map namedEntityGraphMap; private final Map sqlFunctionMap; - private final java.util.Collection cacheRegionConfigBuilders; private final Database database; MetadataImpl( @@ -101,7 +99,6 @@ public class MetadataImpl implements MetadataImplementor, Serializable { Map sqlResultSetMappingMap, Map namedEntityGraphMap, Map sqlFunctionMap, - java.util.Collection cacheRegionConfigBuilders, Database database, BootstrapContext bootstrapContext) { this.uuid = uuid; @@ -121,7 +118,6 @@ public class MetadataImpl implements MetadataImplementor, Serializable { this.sqlResultSetMappingMap = sqlResultSetMappingMap; this.namedEntityGraphMap = namedEntityGraphMap; this.sqlFunctionMap = sqlFunctionMap; - this.cacheRegionConfigBuilders = cacheRegionConfigBuilders; this.database = database; this.bootstrapContext = bootstrapContext; }