From d2b740ce5b4a04fcf8a27cf0db505060f1533a1a Mon Sep 17 00:00:00 2001 From: Jan Schatteman Date: Mon, 31 Jan 2022 19:14:48 +0100 Subject: [PATCH] Jrenaat 6.0 deprecation removals (#4718) * Removed deprecated org.hibernate.boot.jaxb.internal.stax.LocalSchema Signed-off-by: Jan Schatteman * Remove some deprecations from org.hibernate.engine.jdbc Signed-off-by: Jan Schatteman * Remove deprecated misspelled method in PostActionEventListener Signed-off-by: Jan Schatteman * Remove deprecated getSource() from AbstractPreDatabaseOperationEvent Signed-off-by: Jan Schatteman * Privatize deprecated buildOptimizer method in OptimizerFactory Signed-off-by: Jan Schatteman * Remove deprecated ServiceContributingIntegrator Signed-off-by: Jan Schatteman * Remove some more deprecated features Signed-off-by: Jan Schatteman --- .../chapters/bootstrap/Bootstrap.adoc | 5 +- .../hibernate/DuplicateMappingException.java | 33 +----- .../org/hibernate/InstantiationException.java | 12 -- .../internal/stax/JpaOrmXmlEventReader.java | 6 - .../boot/jaxb/internal/stax/LocalSchema.java | 107 ------------------ .../StandardServiceRegistryBuilder.java | 14 --- .../internal/CollectionCacheInvalidator.java | 2 +- .../hibernate/engine/jdbc/WrappedNClob.java | 8 -- .../engine/jdbc/spi/JdbcCoordinator.java | 19 +--- .../engine/jdbc/spi/SqlStatementLogger.java | 22 ---- .../PostDeleteEventListenerStandardImpl.java | 2 +- .../PostInsertEventListenerStandardImpl.java | 2 +- .../PostUpdateEventListenerStandardImpl.java | 2 +- .../AbstractPreDatabaseOperationEvent.java | 18 +-- .../event/spi/PostActionEventListener.java | 16 +-- .../id/enhanced/OptimizerFactory.java | 14 +-- .../spi/ServiceContributingIntegrator.java | 29 ----- .../hibernate/internal/util/StringHelper.java | 8 -- .../LoadEntityWithElementCollectionTest.java | 2 +- .../MergeListPreAndPostPersistTest.java | 2 +- ...ListPreAndPostPersistWithIdentityTest.java | 2 +- .../events/LegacyPostCommitListenerTest.java | 6 +- .../test/events/PostCommitListenerTest.java | 6 +- .../SessionWithSharedConnectionTest.java | 2 +- .../EnversPostDeleteEventListenerImpl.java | 2 +- .../EnversPostInsertEventListenerImpl.java | 2 +- .../EnversPostUpdateEventListenerImpl.java | 2 +- .../basic/RegisterUserEventListenersTest.java | 2 +- 28 files changed, 28 insertions(+), 319 deletions(-) delete mode 100644 hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalSchema.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/integrator/spi/ServiceContributingIntegrator.java diff --git a/documentation/src/main/asciidoc/userguide/chapters/bootstrap/Bootstrap.adoc b/documentation/src/main/asciidoc/userguide/chapters/bootstrap/Bootstrap.adoc index 1f20a29654..df84daa08d 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/bootstrap/Bootstrap.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/bootstrap/Bootstrap.adoc @@ -17,7 +17,7 @@ During the bootstrap process, you might want to customize Hibernate behavior so === Native Bootstrapping This section discusses the process of bootstrapping a Hibernate `SessionFactory`. -Specifically, it addresses the bootstrapping APIs as redesigned in 5.0. +Specifically, it addresses the bootstrapping APIs. For a discussion of the legacy bootstrapping API, see <>. [[bootstrap-native-registry]] @@ -86,8 +86,7 @@ include::{sourcedir}/BootstrapTest.java[tags=bootstrap-bootstrap-native-registry [[bootstrap-event-listener-registration]] ==== Event Listener registration -The main use cases for an `org.hibernate.integrator.spi.Integrator` right now are registering event listeners and providing services (see `org.hibernate.integrator.spi.ServiceContributingIntegrator`). -With 5.0 we plan on expanding that to allow altering the metamodel describing the mapping between object and relational models. +The main use cases for an `org.hibernate.integrator.spi.Integrator` right now are registering event listeners. [[bootstrap-event-listener-registration-example]] .Configuring an event listener diff --git a/hibernate-core/src/main/java/org/hibernate/DuplicateMappingException.java b/hibernate-core/src/main/java/org/hibernate/DuplicateMappingException.java index cbe3ecc40e..9e74ec9c6d 100644 --- a/hibernate-core/src/main/java/org/hibernate/DuplicateMappingException.java +++ b/hibernate-core/src/main/java/org/hibernate/DuplicateMappingException.java @@ -75,20 +75,7 @@ public class DuplicateMappingException extends MappingException { * @param name The name of the duplicated thing. */ public DuplicateMappingException(Type type, String name) { - this( type.text, name ); - } - - /** - * Creates a DuplicateMappingException using the given type and name. - * - * @param type The type of the duplicated thing. - * @param name The name of the duplicated thing. - * - * @deprecated Use the for taking {@link Type} instead. - */ - @Deprecated - public DuplicateMappingException(String type, String name) { - this( "Duplicate " + type + " mapping " + name, type, name ); + this ( "Duplicate " + type.text + " mapping " + name, type, name ); } /** @@ -99,23 +86,9 @@ public class DuplicateMappingException extends MappingException { * @param name The name of the duplicated thing. */ public DuplicateMappingException(String customMessage, Type type, String name) { - this( customMessage, type.name(), name ); - } - - /** - * Creates a DuplicateMappingException using the given customMessage, type and name. - * - * @param customMessage A custom exception message explaining the exception condition - * @param type The type of the duplicated thing. - * @param name The name of the duplicated thing. - * - * @deprecated Use the for taking {@link Type} instead. - */ - @Deprecated - public DuplicateMappingException(String customMessage, String type, String name) { super( customMessage ); - this.type=type; - this.name=name; + this.type = type.name(); + this.name = name; } public String getType() { diff --git a/hibernate-core/src/main/java/org/hibernate/InstantiationException.java b/hibernate-core/src/main/java/org/hibernate/InstantiationException.java index a27373b3b4..ed3e3bdafa 100644 --- a/hibernate-core/src/main/java/org/hibernate/InstantiationException.java +++ b/hibernate-core/src/main/java/org/hibernate/InstantiationException.java @@ -48,18 +48,6 @@ public class InstantiationException extends HibernateException { this.clazz = clazz; } - /** - * Returns the Class we were attempting to instantiate. - * - * @deprecated Use {@link #getUninstantiatableClass} instead - * - * @return The class we are unable to instantiate - */ - @Deprecated - public Class getPersistentClass() { - return clazz; - } - /** * Returns the Class we were attempting to instantiate. * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/JpaOrmXmlEventReader.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/JpaOrmXmlEventReader.java index 50f3b0ec9a..4784f6f596 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/JpaOrmXmlEventReader.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/JpaOrmXmlEventReader.java @@ -137,12 +137,6 @@ public class JpaOrmXmlEventReader extends EventReaderDelegate { private List mapNamespaces(Iterator originalNamespaceIterator ) { final List mappedNamespaces = new ArrayList<>(); -// final String elementNamespacePrefix = startElement.getName().getPrefix(); -// if ( EMPTY_NAMESPACE_PREFIX.equals( elementNamespacePrefix ) ) { -// // add the default namespace mapping -// mappedNamespaces.add( xmlEventFactory.createNamespace( LocalSchema.ORM.getNamespaceUri() ) ); -// } - while ( originalNamespaceIterator.hasNext() ) { final Namespace originalNamespace = originalNamespaceIterator.next(); final Namespace mappedNamespace = mapNamespace( originalNamespace ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalSchema.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalSchema.java deleted file mode 100644 index 9f22cb2ff3..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalSchema.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . - */ -package org.hibernate.boot.jaxb.internal.stax; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import javax.xml.XMLConstants; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; - -import org.jboss.logging.Logger; - -/** - * @author Steve Ebersole - * - * @deprecated No longer used locally. See {@link org.hibernate.boot.xsd.MappingXsdSupport} - * and {@link org.hibernate.boot.xsd.ConfigXsdSupport} - */ -@Deprecated -public enum LocalSchema { - ORM( - "http://www.hibernate.org/xsd/orm/mapping", - "org/hibernate/jpa/orm_2_1.xsd", - "2.1" - ), - HBM( - "http://www.hibernate.org/xsd/orm/hbm", - "org/hibernate/xsd/mapping/legacy-mapping-4.0.xsd", - "4.0" - ), - CFG( - "http://www.hibernate.org/xsd/orm/cfg", - "org/hibernate/hibernate-configuration-4.0.xsd", - "4.0" - - ) - ; - - private static final Logger log = Logger.getLogger( LocalSchema.class ); - - private final String namespaceUri; - private final String localResourceName; - private final String currentVersion; - private final Schema schema; - - LocalSchema(String namespaceUri, String localResourceName, String currentVersion) { - this.namespaceUri = namespaceUri; - this.localResourceName = localResourceName; - this.currentVersion = currentVersion; - this.schema = resolveLocalSchema( localResourceName ); - } - - public String getNamespaceUri() { - return namespaceUri; - } - - public String getCurrentVersion() { - return currentVersion; - } - - public Schema getSchema() { - return schema; - } - - private static Schema resolveLocalSchema(String schemaName) { - return resolveLocalSchema( resolveLocalSchemaUrl( schemaName ) ); - } - - private static URL resolveLocalSchemaUrl(String schemaName) { - URL url = LocalSchema.class.getClassLoader().getResource( schemaName ); - if ( url == null ) { - throw new XmlInfrastructureException( "Unable to locate schema [" + schemaName + "] via classpath" ); - } - return url; - } - - private static Schema resolveLocalSchema(URL schemaUrl) { - try { - InputStream schemaStream = schemaUrl.openStream(); - try { - StreamSource source = new StreamSource( schemaUrl.openStream() ); - SchemaFactory schemaFactory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI ); - return schemaFactory.newSchema( source ); - } - catch (Exception e) { - throw new XmlInfrastructureException( "Unable to load schema [" + schemaUrl.toExternalForm() + "]", e ); - } - finally { - try { - schemaStream.close(); - } - catch (IOException e) { - log.debugf( "Problem closing schema stream - %s", e.toString() ); - } - } - } - catch (IOException e) { - throw new XmlInfrastructureException( "Stream error handling schema url [" + schemaUrl.toExternalForm() + "]" ); - } - } -} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java index bb2baf9b9a..27989e0724 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java @@ -20,8 +20,6 @@ import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; -import org.hibernate.integrator.spi.Integrator; -import org.hibernate.integrator.spi.IntegratorService; import org.hibernate.internal.util.PropertiesHelper; import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.service.Service; @@ -382,7 +380,6 @@ public class StandardServiceRegistryBuilder { * @return A newly-instantiated {@link StandardServiceRegistry} */ public StandardServiceRegistry build() { - applyServiceContributingIntegrators(); applyServiceContributors(); final Map settingsCopy = new HashMap<>( settings ); @@ -398,17 +395,6 @@ public class StandardServiceRegistryBuilder { ); } - @SuppressWarnings("deprecation") - private void applyServiceContributingIntegrators() { - for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class ) - .getIntegrators() ) { - if ( integrator instanceof org.hibernate.integrator.spi.ServiceContributingIntegrator ) { - ( (org.hibernate.integrator.spi.ServiceContributingIntegrator) integrator ) - .prepareServices(this ); - } - } - } - private void applyServiceContributors() { final Iterable serviceContributors = bootstrapServiceRegistry.getService( ClassLoaderService.class ) diff --git a/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java b/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java index 498f7d523b..afd8085b33 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java @@ -70,7 +70,7 @@ public class CollectionCacheInvalidator } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/WrappedNClob.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/WrappedNClob.java index b97ca52a16..fe3f1167c1 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/WrappedNClob.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/WrappedNClob.java @@ -14,14 +14,6 @@ import java.sql.NClob; * @author Steve Ebersole */ public interface WrappedNClob extends WrappedClob { - /** - * {@inheritDoc} - * - * @deprecated Use {@link #getWrappedNClob()} instead - */ - @Override - @Deprecated - NClob getWrappedClob(); /** * Retrieve the wrapped {@link java.sql.Blob} reference diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/JdbcCoordinator.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/JdbcCoordinator.java index 90a58d8464..430148f087 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/JdbcCoordinator.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/JdbcCoordinator.java @@ -15,7 +15,6 @@ import java.sql.Statement; import org.hibernate.engine.jdbc.batch.spi.Batch; import org.hibernate.engine.jdbc.batch.spi.BatchKey; import org.hibernate.jdbc.WorkExecutorVisitable; -import org.hibernate.resource.jdbc.ResourceRegistry; import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor; import org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess; import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner; @@ -27,12 +26,6 @@ import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner; * @author Brett Meyer */ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwner, JdbcResourceTransactionAccess { -// /** -// * Retrieve the transaction coordinator associated with this JDBC coordinator. -// * -// * @return The transaction coordinator -// */ -// public TransactionCoordinator getTransactionCoordinator(); /** * Retrieves the logical connection associated with this JDBC coordinator. @@ -128,10 +121,10 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn /** * Calculate the amount of time, in seconds, still remaining before transaction timeout occurs. * - * @return The number of seconds remaining until until a transaction timeout occurs. A negative value indicates + * @return The number of seconds remaining until a transaction timeout occurs. A negative value indicates * no timeout was requested. * - * @throws org.hibernate.TransactionException Indicates the time out period has already been exceeded. + * @throws org.hibernate.TransactionException Indicates the timeout period has already been exceeded. */ int determineRemainingTransactionTimeOutPeriod(); @@ -159,14 +152,6 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn */ boolean isReadyForSerialization(); - /** - * @deprecated access via {@link #getLogicalConnection} instead - */ - @Deprecated(since = "5.2") - default ResourceRegistry getResourceRegistry() { - return getLogicalConnection().getResourceRegistry(); - } - void serialize(ObjectOutputStream objectOutputStream) throws IOException; } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java index f1c2224e1d..3e7de1f179 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java @@ -85,32 +85,10 @@ public class SqlStatementLogger { return logToStdout; } - /** - * Enable (true) or disable (false) logging to stdout. - * - * @param logToStdout True to enable logging to stdout; false to disable. - * - * @deprecated Will likely be removed: - * Should either become immutable or threadsafe. - */ - @Deprecated - public void setLogToStdout(boolean logToStdout) { - this.logToStdout = logToStdout; - } - public boolean isFormat() { return format; } - /** - * @deprecated Will likely be removed: - * Should either become immutable or threadsafe. - */ - @Deprecated - public void setFormat(boolean format) { - this.format = format; - } - public long getLogSlowQuery() { return logSlowQuery; } diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/PostDeleteEventListenerStandardImpl.java b/hibernate-core/src/main/java/org/hibernate/event/internal/PostDeleteEventListenerStandardImpl.java index f12e344f92..0fae969859 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/PostDeleteEventListenerStandardImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/PostDeleteEventListenerStandardImpl.java @@ -32,7 +32,7 @@ public class PostDeleteEventListenerStandardImpl implements PostDeleteEventListe } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_REMOVE ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/PostInsertEventListenerStandardImpl.java b/hibernate-core/src/main/java/org/hibernate/event/internal/PostInsertEventListenerStandardImpl.java index eda6fb03c4..ac80abee20 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/PostInsertEventListenerStandardImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/PostInsertEventListenerStandardImpl.java @@ -32,7 +32,7 @@ public class PostInsertEventListenerStandardImpl implements PostInsertEventListe } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_PERSIST ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/PostUpdateEventListenerStandardImpl.java b/hibernate-core/src/main/java/org/hibernate/event/internal/PostUpdateEventListenerStandardImpl.java index 291f96af36..c85fabe4f1 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/PostUpdateEventListenerStandardImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/PostUpdateEventListenerStandardImpl.java @@ -41,7 +41,7 @@ public class PostUpdateEventListenerStandardImpl implements PostUpdateEventListe } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_UPDATE ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java b/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java index ec623206af..9faf21bea9 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java @@ -64,21 +64,5 @@ public abstract class AbstractPreDatabaseOperationEvent extends AbstractEvent { public EntityPersister getPersister() { return persister; } - - /** - * Getter for property 'source'. This is the session from which the event - * originated. - *

- * Some of the pre-* events had previous exposed the event source using - * getSource() because they had not originally extended from - * {@link AbstractEvent}. - * - * @return Value for property 'source'. - * - * @deprecated Use {@link #getSession} instead - */ - @Deprecated - public EventSource getSource() { - return getSession(); - } } + diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/PostActionEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/spi/PostActionEventListener.java index 5e9959cbbe..b3cd3118d9 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/PostActionEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/PostActionEventListener.java @@ -19,20 +19,6 @@ interface PostActionEventListener { * @param persister The persister for the entity in question. * * @return {@code true} if after transaction callbacks should be added. - * - * @deprecated use {@link #requiresPostCommitHandling(EntityPersister)} */ - @Deprecated - boolean requiresPostCommitHanding(EntityPersister persister); - - /** - * Does this listener require that after transaction hooks be registered? - * - * @param persister The persister for the entity in question. - * - * @return {@code true} if after transaction callbacks should be added. - */ - default boolean requiresPostCommitHandling(EntityPersister persister) { - return requiresPostCommitHanding( persister ); - } + boolean requiresPostCommitHandling(EntityPersister persister); } diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java index 7adb3ffd7e..5dd29fe4a8 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java @@ -42,19 +42,7 @@ public class OptimizerFactory { private static final Class[] CTOR_SIG = new Class[] { Class.class, int.class }; - /** - * Builds an optimizer - * - * @param type The optimizer type, either a short-hand name or the {@link Optimizer} class name. - * @param returnClass The generated value java type - * @param incrementSize The increment size. - * - * @return The built optimizer - * - * @deprecated Use {@link #buildOptimizer(String, Class, int, long)} instead - */ - @Deprecated - public static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize) { + private static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize) { final Class optimizerClass; final StandardOptimizerDescriptor standardDescriptor = StandardOptimizerDescriptor.fromExternalName( type ); diff --git a/hibernate-core/src/main/java/org/hibernate/integrator/spi/ServiceContributingIntegrator.java b/hibernate-core/src/main/java/org/hibernate/integrator/spi/ServiceContributingIntegrator.java deleted file mode 100644 index de515c4509..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/integrator/spi/ServiceContributingIntegrator.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . - */ -package org.hibernate.integrator.spi; - -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; - -/** - * Additional, optional contract for Integrators that wish to contribute - * {@linkplain org.hibernate.service.Service services} to the Hibernate - * {@link org.hibernate.service.ServiceRegistry}. - * - * @author Steve Ebersole - * - * @deprecated A separate {@link org.hibernate.service.spi.ServiceContributor} should be used instead. - */ -@Deprecated -public interface ServiceContributingIntegrator extends Integrator { - /** - * Allow the integrator to alter the builder of {@link org.hibernate.service.ServiceRegistry}, presumably to - * register services into it. - * - * @param serviceRegistryBuilder The build to prepare. - */ - void prepareServices(StandardServiceRegistryBuilder serviceRegistryBuilder); -} diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java index 456c784f1e..6192c8fa82 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java @@ -544,14 +544,6 @@ public final class StringHelper { return string == null || string.isBlank(); } - /** - * @deprecated use {@link #isBlank(String)} - */ - @Deprecated - public static boolean isEmptyOrWhitespace(String string) { - return isBlank(string); - } - public static String qualify(String prefix, String name) { if ( name == null || prefix == null ) { throw new NullPointerException( "prefix or name were null attempting to build qualified name" ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/collection/LoadEntityWithElementCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/collection/LoadEntityWithElementCollectionTest.java index 0590743fa8..7fb11119f8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/collection/LoadEntityWithElementCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/collection/LoadEntityWithElementCollectionTest.java @@ -54,7 +54,7 @@ public class LoadEntityWithElementCollectionTest { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return false; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java index e3f310c4cf..71f5182194 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistTest.java @@ -156,7 +156,7 @@ public class MergeListPreAndPostPersistTest extends BaseCoreFunctionalTestCase { } } - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return false; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java index 7c8168a1f3..19f2f0e725 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/event/entity/MergeListPreAndPostPersistWithIdentityTest.java @@ -165,7 +165,7 @@ public class MergeListPreAndPostPersistWithIdentityTest extends BaseCoreFunction } } - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return false; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java index a94923bccf..ec32a3e52b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/LegacyPostCommitListenerTest.java @@ -226,7 +226,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } @@ -240,7 +240,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } @@ -254,7 +254,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java index 59583b4f34..b1d7e0ef82 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/events/PostCommitListenerTest.java @@ -241,7 +241,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } @@ -261,7 +261,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } @@ -281,7 +281,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/sharedSession/SessionWithSharedConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/sharedSession/SessionWithSharedConnectionTest.java index 90fdda4d2b..6dc46f2cdb 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/sharedSession/SessionWithSharedConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/sharedSession/SessionWithSharedConnectionTest.java @@ -205,7 +205,7 @@ public class SessionWithSharedConnectionTest { } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; } } diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostDeleteEventListenerImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostDeleteEventListenerImpl.java index 2ed4cad353..7c3d62a667 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostDeleteEventListenerImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostDeleteEventListenerImpl.java @@ -59,7 +59,7 @@ public class EnversPostDeleteEventListenerImpl extends BaseEnversEventListener i } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() ); } } diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostInsertEventListenerImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostInsertEventListenerImpl.java index fcd2b96adb..ae58e62aab 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostInsertEventListenerImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostInsertEventListenerImpl.java @@ -59,7 +59,7 @@ public class EnversPostInsertEventListenerImpl extends BaseEnversEventListener i } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() ); } } diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostUpdateEventListenerImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostUpdateEventListenerImpl.java index 8281071f13..4c01fa7099 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostUpdateEventListenerImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostUpdateEventListenerImpl.java @@ -85,7 +85,7 @@ public class EnversPostUpdateEventListenerImpl extends BaseEnversUpdateEventList } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() ); } } diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/basic/RegisterUserEventListenersTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/basic/RegisterUserEventListenersTest.java index 14da84efe3..c12a7e2c16 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/basic/RegisterUserEventListenersTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/basic/RegisterUserEventListenersTest.java @@ -79,7 +79,7 @@ public class RegisterUserEventListenersTest extends BaseEnversFunctionalTestCase } @Override - public boolean requiresPostCommitHanding(EntityPersister persister) { + public boolean requiresPostCommitHandling(EntityPersister persister) { return true; }