Jrenaat 6.0 deprecation removals (#4718)
* Removed deprecated org.hibernate.boot.jaxb.internal.stax.LocalSchema Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Remove some deprecations from org.hibernate.engine.jdbc Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Remove deprecated misspelled method in PostActionEventListener Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Remove deprecated getSource() from AbstractPreDatabaseOperationEvent Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Privatize deprecated buildOptimizer method in OptimizerFactory Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Remove deprecated ServiceContributingIntegrator Signed-off-by: Jan Schatteman <jschatte@redhat.com> * Remove some more deprecated features Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
0ad5796ffd
commit
d2b740ce5b
|
@ -17,7 +17,7 @@ During the bootstrap process, you might want to customize Hibernate behavior so
|
||||||
=== Native Bootstrapping
|
=== Native Bootstrapping
|
||||||
|
|
||||||
This section discusses the process of bootstrapping a Hibernate `SessionFactory`.
|
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 <<appendices/Legacy_Bootstrap.adoc#appendix-legacy-bootstrap,Legacy Bootstrapping>>.
|
For a discussion of the legacy bootstrapping API, see <<appendices/Legacy_Bootstrap.adoc#appendix-legacy-bootstrap,Legacy Bootstrapping>>.
|
||||||
|
|
||||||
[[bootstrap-native-registry]]
|
[[bootstrap-native-registry]]
|
||||||
|
@ -86,8 +86,7 @@ include::{sourcedir}/BootstrapTest.java[tags=bootstrap-bootstrap-native-registry
|
||||||
[[bootstrap-event-listener-registration]]
|
[[bootstrap-event-listener-registration]]
|
||||||
==== 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`).
|
The main use cases for an `org.hibernate.integrator.spi.Integrator` right now are registering event listeners.
|
||||||
With 5.0 we plan on expanding that to allow altering the metamodel describing the mapping between object and relational models.
|
|
||||||
|
|
||||||
[[bootstrap-event-listener-registration-example]]
|
[[bootstrap-event-listener-registration-example]]
|
||||||
.Configuring an event listener
|
.Configuring an event listener
|
||||||
|
|
|
@ -75,20 +75,7 @@ public class DuplicateMappingException extends MappingException {
|
||||||
* @param name The name of the duplicated thing.
|
* @param name The name of the duplicated thing.
|
||||||
*/
|
*/
|
||||||
public DuplicateMappingException(Type type, String name) {
|
public DuplicateMappingException(Type type, String name) {
|
||||||
this( type.text, name );
|
this ( "Duplicate " + type.text + " mapping " + name, type, 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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,23 +86,9 @@ public class DuplicateMappingException extends MappingException {
|
||||||
* @param name The name of the duplicated thing.
|
* @param name The name of the duplicated thing.
|
||||||
*/
|
*/
|
||||||
public DuplicateMappingException(String customMessage, Type type, String name) {
|
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 );
|
super( customMessage );
|
||||||
this.type=type;
|
this.type = type.name();
|
||||||
this.name=name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
|
|
|
@ -48,18 +48,6 @@ public class InstantiationException extends HibernateException {
|
||||||
this.clazz = clazz;
|
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.
|
* Returns the Class we were attempting to instantiate.
|
||||||
*
|
*
|
||||||
|
|
|
@ -137,12 +137,6 @@ public class JpaOrmXmlEventReader extends EventReaderDelegate {
|
||||||
private List<Namespace> mapNamespaces(Iterator<Namespace> originalNamespaceIterator ) {
|
private List<Namespace> mapNamespaces(Iterator<Namespace> originalNamespaceIterator ) {
|
||||||
final List<Namespace> mappedNamespaces = new ArrayList<>();
|
final List<Namespace> 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() ) {
|
while ( originalNamespaceIterator.hasNext() ) {
|
||||||
final Namespace originalNamespace = originalNamespaceIterator.next();
|
final Namespace originalNamespace = originalNamespaceIterator.next();
|
||||||
final Namespace mappedNamespace = mapNamespace( originalNamespace );
|
final Namespace mappedNamespace = mapNamespace( originalNamespace );
|
||||||
|
|
|
@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
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() + "]" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -20,8 +20,6 @@ import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||||
import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
|
import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
import org.hibernate.cfg.Environment;
|
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.PropertiesHelper;
|
||||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||||
import org.hibernate.service.Service;
|
import org.hibernate.service.Service;
|
||||||
|
@ -382,7 +380,6 @@ public class StandardServiceRegistryBuilder {
|
||||||
* @return A newly-instantiated {@link StandardServiceRegistry}
|
* @return A newly-instantiated {@link StandardServiceRegistry}
|
||||||
*/
|
*/
|
||||||
public StandardServiceRegistry build() {
|
public StandardServiceRegistry build() {
|
||||||
applyServiceContributingIntegrators();
|
|
||||||
applyServiceContributors();
|
applyServiceContributors();
|
||||||
|
|
||||||
final Map<String,Object> settingsCopy = new HashMap<>( settings );
|
final Map<String,Object> 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() {
|
private void applyServiceContributors() {
|
||||||
final Iterable<ServiceContributor> serviceContributors =
|
final Iterable<ServiceContributor> serviceContributors =
|
||||||
bootstrapServiceRegistry.getService( ClassLoaderService.class )
|
bootstrapServiceRegistry.getService( ClassLoaderService.class )
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class CollectionCacheInvalidator
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,14 +14,6 @@ import java.sql.NClob;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public interface WrappedNClob extends WrappedClob {
|
public interface WrappedNClob extends WrappedClob {
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link #getWrappedNClob()} instead
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
NClob getWrappedClob();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the wrapped {@link java.sql.Blob} reference
|
* Retrieve the wrapped {@link java.sql.Blob} reference
|
||||||
|
|
|
@ -15,7 +15,6 @@ import java.sql.Statement;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
||||||
import org.hibernate.jdbc.WorkExecutorVisitable;
|
import org.hibernate.jdbc.WorkExecutorVisitable;
|
||||||
import org.hibernate.resource.jdbc.ResourceRegistry;
|
|
||||||
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
|
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
|
||||||
import org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess;
|
import org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess;
|
||||||
import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner;
|
import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner;
|
||||||
|
@ -27,12 +26,6 @@ import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner;
|
||||||
* @author Brett Meyer
|
* @author Brett Meyer
|
||||||
*/
|
*/
|
||||||
public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwner, JdbcResourceTransactionAccess {
|
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.
|
* 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.
|
* 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.
|
* 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();
|
int determineRemainingTransactionTimeOutPeriod();
|
||||||
|
|
||||||
|
@ -159,14 +152,6 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn
|
||||||
*/
|
*/
|
||||||
boolean isReadyForSerialization();
|
boolean isReadyForSerialization();
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated access via {@link #getLogicalConnection} instead
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "5.2")
|
|
||||||
default ResourceRegistry getResourceRegistry() {
|
|
||||||
return getLogicalConnection().getResourceRegistry();
|
|
||||||
}
|
|
||||||
|
|
||||||
void serialize(ObjectOutputStream objectOutputStream) throws IOException;
|
void serialize(ObjectOutputStream objectOutputStream) throws IOException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,32 +85,10 @@ public class SqlStatementLogger {
|
||||||
return logToStdout;
|
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() {
|
public boolean isFormat() {
|
||||||
return format;
|
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() {
|
public long getLogSlowQuery() {
|
||||||
return logSlowQuery;
|
return logSlowQuery;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class PostDeleteEventListenerStandardImpl implements PostDeleteEventListe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_REMOVE );
|
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_REMOVE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class PostInsertEventListenerStandardImpl implements PostInsertEventListe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_PERSIST );
|
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_PERSIST );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class PostUpdateEventListenerStandardImpl implements PostUpdateEventListe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_UPDATE );
|
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_UPDATE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,21 +64,5 @@ public abstract class AbstractPreDatabaseOperationEvent extends AbstractEvent {
|
||||||
public EntityPersister getPersister() {
|
public EntityPersister getPersister() {
|
||||||
return persister;
|
return persister;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter for property 'source'. This is the session from which the event
|
|
||||||
* originated.
|
|
||||||
* <p/>
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,20 +19,6 @@ interface PostActionEventListener {
|
||||||
* @param persister The persister for the entity in question.
|
* @param persister The persister for the entity in question.
|
||||||
*
|
*
|
||||||
* @return {@code true} if after transaction callbacks should be added.
|
* @return {@code true} if after transaction callbacks should be added.
|
||||||
*
|
|
||||||
* @deprecated use {@link #requiresPostCommitHandling(EntityPersister)}
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
boolean requiresPostCommitHandling(EntityPersister persister);
|
||||||
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 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,19 +42,7 @@ public class OptimizerFactory {
|
||||||
|
|
||||||
private static final Class[] CTOR_SIG = new Class[] { Class.class, int.class };
|
private static final Class[] CTOR_SIG = new Class[] { Class.class, int.class };
|
||||||
|
|
||||||
/**
|
private static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize) {
|
||||||
* 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) {
|
|
||||||
final Class<? extends Optimizer> optimizerClass;
|
final Class<? extends Optimizer> optimizerClass;
|
||||||
|
|
||||||
final StandardOptimizerDescriptor standardDescriptor = StandardOptimizerDescriptor.fromExternalName( type );
|
final StandardOptimizerDescriptor standardDescriptor = StandardOptimizerDescriptor.fromExternalName( type );
|
||||||
|
|
|
@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
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);
|
|
||||||
}
|
|
|
@ -544,14 +544,6 @@ public final class StringHelper {
|
||||||
return string == null || string.isBlank();
|
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) {
|
public static String qualify(String prefix, String name) {
|
||||||
if ( name == null || prefix == null ) {
|
if ( name == null || prefix == null ) {
|
||||||
throw new NullPointerException( "prefix or name were null attempting to build qualified name" );
|
throw new NullPointerException( "prefix or name were null attempting to build qualified name" );
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class LoadEntityWithElementCollectionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class MergeListPreAndPostPersistTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class MergeListPreAndPostPersistWithIdentityTest extends BaseCoreFunction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ public class LegacyPostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ public class PostCommitListenerTest extends BaseCoreFunctionalTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ public class SessionWithSharedConnectionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class EnversPostDeleteEventListenerImpl extends BaseEnversEventListener i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class EnversPostInsertEventListenerImpl extends BaseEnversEventListener i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class EnversPostUpdateEventListenerImpl extends BaseEnversUpdateEventList
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
return getEnversService().getEntitiesConfigurations().isVersioned( persister.getEntityName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class RegisterUserEventListenersTest extends BaseEnversFunctionalTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresPostCommitHanding(EntityPersister persister) {
|
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue