Skip to content

Commit d2b740c

Browse files
authored
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>
1 parent 0ad5796 commit d2b740c

28 files changed

+28
-319
lines changed

documentation/src/main/asciidoc/userguide/chapters/bootstrap/Bootstrap.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ During the bootstrap process, you might want to customize Hibernate behavior so
1717
=== Native Bootstrapping
1818

1919
This section discusses the process of bootstrapping a Hibernate `SessionFactory`.
20-
Specifically, it addresses the bootstrapping APIs as redesigned in 5.0.
20+
Specifically, it addresses the bootstrapping APIs.
2121
For a discussion of the legacy bootstrapping API, see <<appendices/Legacy_Bootstrap.adoc#appendix-legacy-bootstrap,Legacy Bootstrapping>>.
2222

2323
[[bootstrap-native-registry]]
@@ -86,8 +86,7 @@ include::{sourcedir}/BootstrapTest.java[tags=bootstrap-bootstrap-native-registry
8686
[[bootstrap-event-listener-registration]]
8787
==== Event Listener registration
8888

89-
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`).
90-
With 5.0 we plan on expanding that to allow altering the metamodel describing the mapping between object and relational models.
89+
The main use cases for an `org.hibernate.integrator.spi.Integrator` right now are registering event listeners.
9190

9291
[[bootstrap-event-listener-registration-example]]
9392
.Configuring an event listener

hibernate-core/src/main/java/org/hibernate/DuplicateMappingException.java

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,7 @@ public static enum Type {
7575
* @param name The name of the duplicated thing.
7676
*/
7777
public DuplicateMappingException(Type type, String name) {
78-
this( type.text, name );
79-
}
80-
81-
/**
82-
* Creates a DuplicateMappingException using the given type and name.
83-
*
84-
* @param type The type of the duplicated thing.
85-
* @param name The name of the duplicated thing.
86-
*
87-
* @deprecated Use the for taking {@link Type} instead.
88-
*/
89-
@Deprecated
90-
public DuplicateMappingException(String type, String name) {
91-
this( "Duplicate " + type + " mapping " + name, type, name );
78+
this ( "Duplicate " + type.text + " mapping " + name, type, name );
9279
}
9380

9481
/**
@@ -99,23 +86,9 @@ public DuplicateMappingException(String type, String name) {
9986
* @param name The name of the duplicated thing.
10087
*/
10188
public DuplicateMappingException(String customMessage, Type type, String name) {
102-
this( customMessage, type.name(), name );
103-
}
104-
105-
/**
106-
* Creates a DuplicateMappingException using the given customMessage, type and name.
107-
*
108-
* @param customMessage A custom exception message explaining the exception condition
109-
* @param type The type of the duplicated thing.
110-
* @param name The name of the duplicated thing.
111-
*
112-
* @deprecated Use the for taking {@link Type} instead.
113-
*/
114-
@Deprecated
115-
public DuplicateMappingException(String customMessage, String type, String name) {
11689
super( customMessage );
117-
this.type=type;
118-
this.name=name;
90+
this.type = type.name();
91+
this.name = name;
11992
}
12093

12194
public String getType() {

hibernate-core/src/main/java/org/hibernate/InstantiationException.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,6 @@ public InstantiationException(String message, Class<?> clazz, Exception cause) {
4848
this.clazz = clazz;
4949
}
5050

51-
/**
52-
* Returns the Class we were attempting to instantiate.
53-
*
54-
* @deprecated Use {@link #getUninstantiatableClass} instead
55-
*
56-
* @return The class we are unable to instantiate
57-
*/
58-
@Deprecated
59-
public Class<?> getPersistentClass() {
60-
return clazz;
61-
}
62-
6351
/**
6452
* Returns the Class we were attempting to instantiate.
6553
*

hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/JpaOrmXmlEventReader.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ private List<Namespace> mapNamespaces(StartElement startElement) {
137137
private List<Namespace> mapNamespaces(Iterator<Namespace> originalNamespaceIterator ) {
138138
final List<Namespace> mappedNamespaces = new ArrayList<>();
139139

140-
// final String elementNamespacePrefix = startElement.getName().getPrefix();
141-
// if ( EMPTY_NAMESPACE_PREFIX.equals( elementNamespacePrefix ) ) {
142-
// // add the default namespace mapping
143-
// mappedNamespaces.add( xmlEventFactory.createNamespace( LocalSchema.ORM.getNamespaceUri() ) );
144-
// }
145-
146140
while ( originalNamespaceIterator.hasNext() ) {
147141
final Namespace originalNamespace = originalNamespaceIterator.next();
148142
final Namespace mappedNamespace = mapNamespace( originalNamespace );

hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalSchema.java

Lines changed: 0 additions & 107 deletions
This file was deleted.

hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
2121
import org.hibernate.cfg.AvailableSettings;
2222
import org.hibernate.cfg.Environment;
23-
import org.hibernate.integrator.spi.Integrator;
24-
import org.hibernate.integrator.spi.IntegratorService;
2523
import org.hibernate.internal.util.PropertiesHelper;
2624
import org.hibernate.internal.util.config.ConfigurationHelper;
2725
import org.hibernate.service.Service;
@@ -382,7 +380,6 @@ public StandardServiceRegistryBuilder enableAutoClose() {
382380
* @return A newly-instantiated {@link StandardServiceRegistry}
383381
*/
384382
public StandardServiceRegistry build() {
385-
applyServiceContributingIntegrators();
386383
applyServiceContributors();
387384

388385
final Map<String,Object> settingsCopy = new HashMap<>( settings );
@@ -398,17 +395,6 @@ public StandardServiceRegistry build() {
398395
);
399396
}
400397

401-
@SuppressWarnings("deprecation")
402-
private void applyServiceContributingIntegrators() {
403-
for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class )
404-
.getIntegrators() ) {
405-
if ( integrator instanceof org.hibernate.integrator.spi.ServiceContributingIntegrator ) {
406-
( (org.hibernate.integrator.spi.ServiceContributingIntegrator) integrator )
407-
.prepareServices(this );
408-
}
409-
}
410-
}
411-
412398
private void applyServiceContributors() {
413399
final Iterable<ServiceContributor> serviceContributors =
414400
bootstrapServiceRegistry.getService( ClassLoaderService.class )

hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void onPostInsert(PostInsertEvent event) {
7070
}
7171

7272
@Override
73-
public boolean requiresPostCommitHanding(EntityPersister persister) {
73+
public boolean requiresPostCommitHandling(EntityPersister persister) {
7474
return true;
7575
}
7676

hibernate-core/src/main/java/org/hibernate/engine/jdbc/WrappedNClob.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
* @author Steve Ebersole
1515
*/
1616
public interface WrappedNClob extends WrappedClob {
17-
/**
18-
* {@inheritDoc}
19-
*
20-
* @deprecated Use {@link #getWrappedNClob()} instead
21-
*/
22-
@Override
23-
@Deprecated
24-
NClob getWrappedClob();
2517

2618
/**
2719
* Retrieve the wrapped {@link java.sql.Blob} reference

hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/JdbcCoordinator.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.hibernate.engine.jdbc.batch.spi.Batch;
1616
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
1717
import org.hibernate.jdbc.WorkExecutorVisitable;
18-
import org.hibernate.resource.jdbc.ResourceRegistry;
1918
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
2019
import org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess;
2120
import org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner;
@@ -27,12 +26,6 @@
2726
* @author Brett Meyer
2827
*/
2928
public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwner, JdbcResourceTransactionAccess {
30-
// /**
31-
// * Retrieve the transaction coordinator associated with this JDBC coordinator.
32-
// *
33-
// * @return The transaction coordinator
34-
// */
35-
// public TransactionCoordinator getTransactionCoordinator();
3629

3730
/**
3831
* Retrieves the logical connection associated with this JDBC coordinator.
@@ -128,10 +121,10 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn
128121
/**
129122
* Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.
130123
*
131-
* @return The number of seconds remaining until until a transaction timeout occurs. A negative value indicates
124+
* @return The number of seconds remaining until a transaction timeout occurs. A negative value indicates
132125
* no timeout was requested.
133126
*
134-
* @throws org.hibernate.TransactionException Indicates the time out period has already been exceeded.
127+
* @throws org.hibernate.TransactionException Indicates the timeout period has already been exceeded.
135128
*/
136129
int determineRemainingTransactionTimeOutPeriod();
137130

@@ -159,14 +152,6 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn
159152
*/
160153
boolean isReadyForSerialization();
161154

162-
/**
163-
* @deprecated access via {@link #getLogicalConnection} instead
164-
*/
165-
@Deprecated(since = "5.2")
166-
default ResourceRegistry getResourceRegistry() {
167-
return getLogicalConnection().getResourceRegistry();
168-
}
169-
170155
void serialize(ObjectOutputStream objectOutputStream) throws IOException;
171156

172157
}

hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,10 @@ public boolean isLogToStdout() {
8585
return logToStdout;
8686
}
8787

88-
/**
89-
* Enable (true) or disable (false) logging to stdout.
90-
*
91-
* @param logToStdout True to enable logging to stdout; false to disable.
92-
*
93-
* @deprecated Will likely be removed:
94-
* Should either become immutable or threadsafe.
95-
*/
96-
@Deprecated
97-
public void setLogToStdout(boolean logToStdout) {
98-
this.logToStdout = logToStdout;
99-
}
100-
10188
public boolean isFormat() {
10289
return format;
10390
}
10491

105-
/**
106-
* @deprecated Will likely be removed:
107-
* Should either become immutable or threadsafe.
108-
*/
109-
@Deprecated
110-
public void setFormat(boolean format) {
111-
this.format = format;
112-
}
113-
11492
public long getLogSlowQuery() {
11593
return logSlowQuery;
11694
}

hibernate-core/src/main/java/org/hibernate/event/internal/PostDeleteEventListenerStandardImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void onPostDelete(PostDeleteEvent event) {
3232
}
3333

3434
@Override
35-
public boolean requiresPostCommitHanding(EntityPersister persister) {
35+
public boolean requiresPostCommitHandling(EntityPersister persister) {
3636
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_REMOVE );
3737
}
3838
}

hibernate-core/src/main/java/org/hibernate/event/internal/PostInsertEventListenerStandardImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void onPostInsert(PostInsertEvent event) {
3232
}
3333

3434
@Override
35-
public boolean requiresPostCommitHanding(EntityPersister persister) {
35+
public boolean requiresPostCommitHandling(EntityPersister persister) {
3636
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_PERSIST );
3737
}
3838
}

hibernate-core/src/main/java/org/hibernate/event/internal/PostUpdateEventListenerStandardImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void handlePostUpdate(Object entity, EventSource source) {
4141
}
4242

4343
@Override
44-
public boolean requiresPostCommitHanding(EntityPersister persister) {
44+
public boolean requiresPostCommitHandling(EntityPersister persister) {
4545
return callbackRegistry.hasRegisteredCallbacks( persister.getMappedClass(), CallbackType.POST_UPDATE );
4646
}
4747
}

hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,5 @@ public Object getId() {
6464
public EntityPersister getPersister() {
6565
return persister;
6666
}
67-
68-
/**
69-
* Getter for property 'source'. This is the session from which the event
70-
* originated.
71-
* <p/>
72-
* Some of the pre-* events had previous exposed the event source using
73-
* getSource() because they had not originally extended from
74-
* {@link AbstractEvent}.
75-
*
76-
* @return Value for property 'source'.
77-
*
78-
* @deprecated Use {@link #getSession} instead
79-
*/
80-
@Deprecated
81-
public EventSource getSource() {
82-
return getSession();
83-
}
8467
}
68+

0 commit comments

Comments
 (0)