Remove several deprecations in org.hibernate.boot

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2022-01-21 22:16:43 +01:00 committed by Steve Ebersole
parent d6c4f90f4c
commit dc2e86d5c1
15 changed files with 1 additions and 296 deletions

View File

@ -84,11 +84,6 @@ public class StandardArchiveDescriptorFactory implements ArchiveDescriptorFactor
return ArchiveHelper.getJarURLFromURLEntry( url, entry );
}
@Override
public URL getURLFromPath(String jarPath) {
return ArchiveHelper.getURLFromPath( jarPath );
}
@Override
public URL adjustJarFileEntryUrl(URL url, URL rootUrl) {
final String protocol = url.getProtocol();

View File

@ -23,9 +23,4 @@ public abstract class AbstractArchiveDescriptorFactory implements ArchiveDescrip
public URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException {
return ArchiveHelper.getJarURLFromURLEntry( url, entry );
}
@Override
public URL getURLFromPath(String jarPath) {
return ArchiveHelper.getURLFromPath( jarPath );
}
}

View File

@ -46,16 +46,4 @@ public interface ArchiveDescriptorFactory {
*/
URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException;
/**
* Not used!
*
* @param jarPath The jar path
*
* @return The url from the path?
*
* @deprecated Not used!
*/
@Deprecated
@SuppressWarnings("UnusedDeclaration")
URL getURLFromPath(String jarPath);
}

View File

@ -794,36 +794,6 @@ public class MetadataBuilderImpl implements MetadataBuilderImplementor, TypeCont
return bootstrapContext.getReflectionManager();
}
@Override
public IndexView getJandexView() {
return bootstrapContext.getJandexView();
}
@Override
public ScanOptions getScanOptions() {
return bootstrapContext.getScanOptions();
}
@Override
public ScanEnvironment getScanEnvironment() {
return bootstrapContext.getScanEnvironment();
}
@Override
public Object getScanner() {
return bootstrapContext.getScanner();
}
@Override
public ArchiveDescriptorFactory getArchiveDescriptorFactory() {
return bootstrapContext.getArchiveDescriptorFactory();
}
@Override
public ClassLoader getTempClassLoader() {
return bootstrapContext.getJpaTempClassLoader();
}
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
return implicitNamingStrategy;
@ -854,11 +824,6 @@ public class MetadataBuilderImpl implements MetadataBuilderImplementor, TypeCont
return idGenerationTypeInterpreter;
}
@Override
public List<CacheRegionDefinition> getCacheRegionDefinitions() {
return new ArrayList<>( bootstrapContext.getCacheRegionDefinitions() );
}
@Override
public boolean ignoreExplicitDiscriminatorsForJoinedInheritance() {
return !explicitDiscriminatorsForJoinedInheritanceSupported;

View File

@ -9,7 +9,6 @@ package org.hibernate.boot.internal;
import org.hibernate.boot.model.TypeDefinitionRegistryStandardImpl;
import org.hibernate.boot.model.naming.ObjectNameNormalizer;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.ClassLoaderAccess;
import org.hibernate.boot.spi.InFlightMetadataCollector;
import org.hibernate.boot.spi.MappingDefaults;
import org.hibernate.boot.spi.MetadataBuildingContext;
@ -66,11 +65,6 @@ public class MetadataBuildingContextRootImpl implements MetadataBuildingContext
return metadataCollector;
}
@Override
public ClassLoaderAccess getClassLoaderAccess() {
return bootstrapContext.getClassLoaderAccess();
}
@Override
public ObjectNameNormalizer getObjectNameNormalizer() {
return objectNameNormalizer;

View File

@ -27,7 +27,6 @@ import org.hibernate.boot.model.source.spi.MetadataSourceProcessor;
import org.hibernate.boot.model.source.spi.ToolingHintContext;
import org.hibernate.boot.query.HbmResultSetMappingDescriptor;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.ClassLoaderAccess;
import org.hibernate.boot.spi.InFlightMetadataCollector;
import org.hibernate.boot.spi.MappingDefaults;
import org.hibernate.boot.spi.MetadataBuildingContext;
@ -151,11 +150,6 @@ public class MappingDocument implements HbmLocalMetadataBuildingContext, Metadat
return rootBuildingContext.getMetadataCollector();
}
@Override
public ClassLoaderAccess getClassLoaderAccess() {
return rootBuildingContext.getClassLoaderAccess();
}
@Override
public ObjectNameNormalizer getObjectNameNormalizer() {
return rootBuildingContext.getObjectNameNormalizer();

View File

@ -44,14 +44,6 @@ public class BootstrapServiceRegistryBuilder {
private boolean autoCloseRegistry = true;
/**
* @deprecated Use {@link #applyIntegrator} instead
*/
@Deprecated
public BootstrapServiceRegistryBuilder with(Integrator integrator) {
return applyIntegrator( integrator );
}
/**
* Add an {@link Integrator} to be applied to the bootstrap registry.
*
@ -64,14 +56,6 @@ public class BootstrapServiceRegistryBuilder {
return this;
}
/**
* @deprecated Use {@link #applyClassLoader} instead
*/
@Deprecated
public BootstrapServiceRegistryBuilder with(ClassLoader classLoader) {
return applyClassLoader( classLoader );
}
/**
* Adds a provided {@link ClassLoader} for use in class-loading and resource-lookup.
*
@ -96,14 +80,6 @@ public class BootstrapServiceRegistryBuilder {
tcclLookupPrecedence = precedence;
}
/**
* @deprecated Use {@link #applyClassLoaderService} instead
*/
@Deprecated
public BootstrapServiceRegistryBuilder with(ClassLoaderService classLoaderService) {
return applyClassLoaderService( classLoaderService );
}
/**
* Adds a provided {@link ClassLoaderService} for use in class-loading and resource-lookup.
*
@ -116,15 +92,6 @@ public class BootstrapServiceRegistryBuilder {
return this;
}
/**
* @deprecated Use {@link #applyStrategySelector} instead
*/
@SuppressWarnings( {"UnusedDeclaration"})
@Deprecated
public <T> BootstrapServiceRegistryBuilder withStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation) {
return applyStrategySelector( strategy, name, implementation );
}
/**
* Applies a named strategy implementation to the bootstrap registry.
*
@ -144,15 +111,6 @@ public class BootstrapServiceRegistryBuilder {
return this;
}
/**
* @deprecated Use {@link #applyStrategySelectors} instead
*/
@SuppressWarnings( {"UnusedDeclaration"})
@Deprecated
public BootstrapServiceRegistryBuilder withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider) {
return applyStrategySelectors( strategyRegistrationProvider );
}
/**
* Applies one or more strategy selectors announced as available by the passed announcer.
*

View File

@ -43,16 +43,6 @@ public abstract class AbstractDelegatingMetadataBuilderImplementor<T extends Met
private final MetadataBuilderImplementor delegate;
/**
* Kept for compatibility reason but should be removed as soon as possible.
*
* @deprecated use {@link #delegate()} instead
*/
@Deprecated
public MetadataBuilderImplementor getDelegate() {
return delegate;
}
protected MetadataBuilderImplementor delegate() {
return delegate;
}

View File

@ -11,10 +11,6 @@ import jakarta.persistence.SharedCacheMode;
import org.hibernate.HibernateException;
import org.hibernate.TimeZoneStorageStrategy;
import org.hibernate.annotations.common.reflection.ReflectionManager;
import org.hibernate.boot.CacheRegionDefinition;
import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
import org.hibernate.boot.archive.scan.spi.ScanOptions;
import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory;
import org.hibernate.boot.model.IdGeneratorStrategyInterpreter;
import org.hibernate.boot.model.naming.ImplicitNamingStrategy;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
@ -23,7 +19,6 @@ import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cfg.MetadataSourceType;
import org.hibernate.id.factory.IdentifierGeneratorFactory;
import org.hibernate.type.spi.TypeConfiguration;
import org.jboss.jandex.IndexView;
/**
* Convenience base class for custom implementors of {@link MetadataBuildingOptions} using delegation.
@ -74,36 +69,6 @@ public abstract class AbstractDelegatingMetadataBuildingOptions implements Metad
return delegate.getTypeConfiguration();
}
@Override
public IndexView getJandexView() {
return delegate.getJandexView();
}
@Override
public ScanOptions getScanOptions() {
return delegate.getScanOptions();
}
@Override
public ScanEnvironment getScanEnvironment() {
return delegate.getScanEnvironment();
}
@Override
public Object getScanner() {
return delegate.getScanner();
}
@Override
public ArchiveDescriptorFactory getArchiveDescriptorFactory() {
return delegate.getArchiveDescriptorFactory();
}
@Override
public ClassLoader getTempClassLoader() {
return delegate.getTempClassLoader();
}
@Override
public ImplicitNamingStrategy getImplicitNamingStrategy() {
return delegate.getImplicitNamingStrategy();
@ -139,11 +104,6 @@ public abstract class AbstractDelegatingMetadataBuildingOptions implements Metad
return delegate.getIdGenerationTypeInterpreter();
}
@Override
public List<CacheRegionDefinition> getCacheRegionDefinitions() {
return delegate.getCacheRegionDefinitions();
}
@Override
public boolean ignoreExplicitDiscriminatorsForJoinedInheritance() {
return delegate.ignoreExplicitDiscriminatorsForJoinedInheritance();

View File

@ -44,16 +44,6 @@ public interface MetadataBuildingContext {
*/
InFlightMetadataCollector getMetadataCollector();
/**
* Provides access to ClassLoader services when needed during binding
*
* @return The ClassLoaderAccess
*
* @deprecated Use {@link BootstrapContext#getClassLoaderAccess()}} instead.
*/
@Deprecated
ClassLoaderAccess getClassLoaderAccess();
/**
* Not sure how I feel about this exposed here
*

View File

@ -12,10 +12,6 @@ import jakarta.persistence.SharedCacheMode;
import org.hibernate.TimeZoneStorageStrategy;
import org.hibernate.annotations.common.reflection.ReflectionManager;
import org.hibernate.boot.CacheRegionDefinition;
import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
import org.hibernate.boot.archive.scan.spi.ScanOptions;
import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory;
import org.hibernate.boot.model.IdGeneratorStrategyInterpreter;
import org.hibernate.boot.model.naming.ImplicitNamingStrategy;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
@ -28,9 +24,6 @@ import org.hibernate.id.factory.IdentifierGeneratorFactory;
import org.hibernate.metamodel.internal.ManagedTypeRepresentationResolverStandard;
import org.hibernate.metamodel.spi.ManagedTypeRepresentationResolver;
import org.hibernate.type.spi.TypeConfiguration;
import org.jboss.jandex.IndexView;
import jakarta.persistence.SharedCacheMode;
/**
* Describes the options used while building the Metadata object (during
@ -95,73 +88,6 @@ public interface MetadataBuildingOptions {
@Deprecated
ReflectionManager getReflectionManager();
/**
* Access to the Jandex index passed by call to
* {@link org.hibernate.boot.MetadataBuilder#applyIndexView(IndexView)}, if any.
*
* @return The Jandex index
*
* @deprecated Use {@link BootstrapContext#getJandexView()} instead.
*/
@Deprecated
IndexView getJandexView();
/**
* Access to the options to be used for scanning
*
* @return The scan options
*
* @deprecated Use {@link BootstrapContext#getScanOptions()} instead.
*/
@Deprecated
ScanOptions getScanOptions();
/**
* Access to the environment for scanning. Consider this temporary; see discussion on
* {@link ScanEnvironment}
*
* @return The scan environment
*
* @deprecated Use {@link BootstrapContext#getScanEnvironment()} instead.
*/
@Deprecated
ScanEnvironment getScanEnvironment();
/**
* Access to the Scanner to be used for scanning. Can be:<ul>
* <li>A Scanner instance</li>
* <li>A Class reference to the Scanner implementor</li>
* <li>A String naming the Scanner implementor</li>
* </ul>
*
* @return The scanner
*
* @deprecated Use {@link BootstrapContext#getScanner()} instead.
*/
@Deprecated
Object getScanner();
/**
* Access to the ArchiveDescriptorFactory to be used for scanning
*
* @return The ArchiveDescriptorFactory
*
* @deprecated Use {@link BootstrapContext#getArchiveDescriptorFactory()} instead.
*/
@Deprecated
ArchiveDescriptorFactory getArchiveDescriptorFactory();
/**
* Access the temporary ClassLoader passed to us as defined by
* {@link jakarta.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader()}, if any.
*
* @return The tempo ClassLoader
*
* @deprecated Use {@link BootstrapContext#getJpaTempClassLoader()} instead.
*/
@Deprecated
ClassLoader getTempClassLoader();
ImplicitNamingStrategy getImplicitNamingStrategy();
PhysicalNamingStrategy getPhysicalNamingStrategy();
@ -192,16 +118,6 @@ public interface MetadataBuildingOptions {
TypeConfiguration getTypeConfiguration();
/**
* Access to all explicit cache region mappings.
*
* @return Explicit cache region mappings.
*
* @deprecated Use {@link BootstrapContext#getClassmateContext()} instead.
*/
@Deprecated
List<CacheRegionDefinition> getCacheRegionDefinitions();
/**
* Whether explicit discriminator declarations should be ignored for joined
* subclass style inheritance.

View File

@ -178,15 +178,6 @@ public interface SessionFactoryOptions extends QueryEngineOptions {
boolean isJtaTrackByThread();
/**
* @deprecated Use {@link JpaCompliance#isJpaQueryComplianceEnabled()} instead
* via {@link #getJpaCompliance()}
*/
@Deprecated
default boolean isStrictJpaQueryLanguageCompliance() {
return getJpaCompliance().isJpaQueryComplianceEnabled();
}
boolean isNamedQueryStartupCheckingEnabled();
boolean isSecondLevelCacheEnabled();
@ -292,28 +283,10 @@ public interface SessionFactoryOptions extends QueryEngineOptions {
return Statistics.DEFAULT_QUERY_STATISTICS_MAX_SIZE;
}
/**
* @deprecated Since 5.4.1, this is no longer used.
*/
@Deprecated
default boolean isPostInsertIdentifierDelayableEnabled() {
return true;
}
default boolean areJPACallbacksEnabled() {
return true;
}
/**
* Can bytecode-enhanced entity classes be used as a "proxy"?
*
* @deprecated (since 5.5) use of enhanced proxies is always enabled
*/
@Deprecated
default boolean isEnhancementAsProxyEnabled() {
return true;
}
/**
* Controls whether Hibernate should try to map named parameter names
* specified in a {@link org.hibernate.procedure.ProcedureCall} or

View File

@ -194,7 +194,7 @@ public final class Settings {
}
public boolean isStrictJPAQLCompliance() {
return sessionFactoryOptions.isStrictJpaQueryLanguageCompliance();
return sessionFactoryOptions.getJpaCompliance().isJpaCacheComplianceEnabled();
}
public boolean isNamedQueryStartupCheckingEnabled() {

View File

@ -10,7 +10,6 @@ import org.hibernate.annotations.common.reflection.ReflectionManager;
import org.hibernate.boot.model.TypeDefinitionRegistry;
import org.hibernate.boot.model.naming.ObjectNameNormalizer;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.ClassLoaderAccess;
import org.hibernate.boot.spi.InFlightMetadataCollector;
import org.hibernate.boot.spi.MappingDefaults;
import org.hibernate.boot.spi.MetadataBuildingContext;
@ -74,11 +73,6 @@ public class EnversMetadataBuildingContextImpl implements EnversMetadataBuilding
return metadataCollector;
}
@Override
public ClassLoaderAccess getClassLoaderAccess() {
return metadataCollector.getBootstrapContext().getClassLoaderAccess();
}
@Override
public ObjectNameNormalizer getObjectNameNormalizer() {
return objectNameNormalizer;

View File

@ -12,9 +12,7 @@ import org.hibernate.boot.internal.MetadataBuilderImpl;
import org.hibernate.boot.model.TypeDefinitionRegistryStandardImpl;
import org.hibernate.boot.model.naming.ObjectNameNormalizer;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.ClassLoaderAccess;
import org.hibernate.boot.spi.InFlightMetadataCollector;
import org.hibernate.boot.spi.MappingDefaults;
import org.hibernate.boot.spi.MetadataBuildingContext;
@ -68,11 +66,6 @@ public class MetadataBuildingContextTestingImpl implements MetadataBuildingConte
return metadataCollector;
}
@Override
public ClassLoaderAccess getClassLoaderAccess() {
return bootstrapContext.getClassLoaderAccess();
}
@Override
public ObjectNameNormalizer getObjectNameNormalizer() {
return objectNameNormalizer;