Skip to content

Commit f43f668

Browse files
committed
HHH-12730 Remove the deprecated methods previouly added
We don't need them as everything is now dealt with the transformer.
1 parent 0ada118 commit f43f668

File tree

11 files changed

+24
-801
lines changed

11 files changed

+24
-801
lines changed

hibernate-core/src/main/java/org/hibernate/collection/spi/PersistentCollection.java

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.util.Iterator;
1414

1515
import org.hibernate.HibernateException;
16-
import org.hibernate.engine.spi.SessionImplementor;
1716
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1817
import org.hibernate.loader.CollectionAliases;
1918
import org.hibernate.persister.collection.CollectionPersister;
@@ -84,7 +83,7 @@ public interface PersistentCollection {
8483
* database state is now synchronized with the memory state.
8584
*/
8685
void postAction();
87-
86+
8887
/**
8988
* Return the user-visible collection (or array) instance
9089
*
@@ -103,7 +102,7 @@ public interface PersistentCollection {
103102
* @return Whether to end the read.
104103
*/
105104
boolean endRead();
106-
105+
107106
/**
108107
* Called after initializing from cache
109108
*
@@ -128,20 +127,6 @@ public interface PersistentCollection {
128127
*/
129128
boolean unsetSession(SharedSessionContractImplementor currentSession);
130129

131-
/**
132-
* Disassociate this collection from the given session.
133-
*
134-
* @param currentSession The session we are disassociating from. Used for validations.
135-
*
136-
* @return true if this was currently associated with the given session
137-
*
138-
* @deprecated {@link #unsetSession(SharedSessionContractImplementor)} should be used instead.
139-
*/
140-
@Deprecated
141-
default boolean unsetSession(SessionImplementor currentSession) {
142-
return unsetSession( (SharedSessionContractImplementor) currentSession );
143-
}
144-
145130
/**
146131
* Associate the collection with the given session.
147132
*
@@ -154,23 +139,6 @@ default boolean unsetSession(SessionImplementor currentSession) {
154139
*/
155140
boolean setCurrentSession(SharedSessionContractImplementor session) throws HibernateException;
156141

157-
/**
158-
* Associate the collection with the given session.
159-
*
160-
* @param session The session to associate with
161-
*
162-
* @return false if the collection was already associated with the session
163-
*
164-
* @throws HibernateException if the collection was already associated
165-
* with another open session
166-
*
167-
* @deprecated {@link #setCurrentSession(SharedSessionContractImplementor)} should be used instead.
168-
*/
169-
@Deprecated
170-
default boolean setCurrentSession(SessionImplementor session) throws HibernateException {
171-
return setCurrentSession( (SharedSessionContractImplementor) session );
172-
}
173-
174142
/**
175143
* Read the state of the collection from a disassembled cached value
176144
*
@@ -216,7 +184,7 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
216184
* @return The identifier value
217185
*/
218186
Object getIdentifier(Object entry, int i);
219-
187+
220188
/**
221189
* Get the index of the given collection entry
222190
*
@@ -227,7 +195,7 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
227195
* @return The index value
228196
*/
229197
Object getIndex(Object entry, int i, CollectionPersister persister);
230-
198+
231199
/**
232200
* Get the value of the given collection entry. Generally the given entry parameter value will just be returned.
233201
* Might get a different value for a duplicate entries in a Set.
@@ -237,7 +205,7 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
237205
* @return The corresponding object that is part of the collection elements.
238206
*/
239207
Object getElement(Object entry);
240-
208+
241209
/**
242210
* Get the snapshot value of the given collection entry
243211
*
@@ -275,7 +243,7 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
275243
* @return {@code true} if the given snapshot is empty
276244
*/
277245
boolean isSnapshotEmpty(Serializable snapshot);
278-
246+
279247
/**
280248
* Disassemble the collection to get it ready for the cache
281249
*
@@ -387,7 +355,7 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
387355
* @return The iterator
388356
*/
389357
Iterator queuedAdditionIterator();
390-
358+
391359
/**
392360
* Get the "queued" orphans
393361
*
@@ -396,28 +364,28 @@ Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descri
396364
* @return The orphaned elements
397365
*/
398366
Collection getQueuedOrphans(String entityName);
399-
367+
400368
/**
401369
* Get the current collection key value
402370
*
403371
* @return the current collection key value
404372
*/
405373
Serializable getKey();
406-
374+
407375
/**
408376
* Get the current role name
409377
*
410378
* @return the collection role name
411379
*/
412380
String getRole();
413-
381+
414382
/**
415383
* Is the collection unreferenced?
416384
*
417385
* @return {@code true} if the collection is no longer referenced by an owner
418386
*/
419387
boolean isUnreferenced();
420-
388+
421389
/**
422390
* Is the collection dirty? Note that this is only
423391
* reliable during the flush cycle, after the
@@ -437,19 +405,19 @@ default boolean isElementRemoved(){
437405
* to the database.
438406
*/
439407
void clearDirty();
440-
408+
441409
/**
442410
* Get the snapshot cached by the collection instance
443411
*
444412
* @return The internally stored snapshot state
445413
*/
446414
Serializable getStoredSnapshot();
447-
415+
448416
/**
449417
* Mark the collection as dirty
450418
*/
451419
void dirty();
452-
420+
453421
/**
454422
* Called before inserting rows, to ensure that any surrogate keys
455423
* are fully generated
@@ -476,5 +444,5 @@ default boolean isElementRemoved(){
476444
* @return The orphans
477445
*/
478446
Collection getOrphans(Serializable snapshot, String entityName);
479-
447+
480448
}

hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.hibernate.engine.jdbc.Size;
2121
import org.hibernate.engine.spi.Mapping;
2222
import org.hibernate.engine.spi.SessionFactoryImplementor;
23-
import org.hibernate.engine.spi.SessionImplementor;
2423
import org.hibernate.engine.spi.SharedSessionContractImplementor;
2524
import org.hibernate.internal.util.collections.ArrayHelper;
2625
import org.hibernate.type.descriptor.WrapperOptions;
@@ -107,13 +106,13 @@ protected static Size getDefaultSize() {
107106
protected Size getDictatedSize() {
108107
return dictatedSize;
109108
}
110-
109+
111110
// final implementations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112111

113112
public final JavaTypeDescriptor<T> getJavaTypeDescriptor() {
114113
return javaTypeDescriptor;
115114
}
116-
115+
117116
public final void setJavaTypeDescriptor( JavaTypeDescriptor<T> javaTypeDescriptor ) {
118117
this.javaTypeDescriptor = javaTypeDescriptor;
119118
}
@@ -258,15 +257,6 @@ public final T nullSafeGet(ResultSet rs, String name, final SharedSessionContrac
258257
return nullSafeGet( rs, name, (WrapperOptions) session );
259258
}
260259

261-
/**
262-
* @deprecated {@link #nullSafeGet(ResultSet, String, SharedSessionContractImplementor)}
263-
* should be used instead.
264-
*/
265-
@Deprecated
266-
public final T nullSafeGet(ResultSet rs, String name, final SessionImplementor session) throws SQLException {
267-
return nullSafeGet( rs, name, (SharedSessionContractImplementor) session );
268-
}
269-
270260
protected final T nullSafeGet(ResultSet rs, String name, WrapperOptions options) throws SQLException {
271261
return remapSqlTypeDescriptor( options ).getExtractor( javaTypeDescriptor ).extract( rs, name, options );
272262
}
@@ -275,14 +265,6 @@ public Object get(ResultSet rs, String name, SharedSessionContractImplementor se
275265
return nullSafeGet( rs, name, session );
276266
}
277267

278-
/**
279-
* @deprecated {@link #get(ResultSet, String, SharedSessionContractImplementor)} should be used instead.
280-
*/
281-
@Deprecated
282-
public Object get(ResultSet rs, String name, SessionImplementor session) throws HibernateException, SQLException {
283-
return get( rs, name, (SharedSessionContractImplementor) session );
284-
}
285-
286268
@Override
287269
@SuppressWarnings({ "unchecked" })
288270
public final void nullSafeSet(
@@ -306,15 +288,6 @@ public void set(PreparedStatement st, T value, int index, SharedSessionContractI
306288
nullSafeSet( st, value, index, session );
307289
}
308290

309-
/**
310-
* @deprecated {@link #set(PreparedStatement, Object, int, SharedSessionContractImplementor)}
311-
* should be used instead.
312-
*/
313-
@Deprecated
314-
public void set(PreparedStatement st, T value, int index, SessionImplementor session) throws HibernateException, SQLException {
315-
set( st, value, index, (SharedSessionContractImplementor) session );
316-
}
317-
318291
@Override
319292
@SuppressWarnings({ "unchecked" })
320293
public final String toLoggableString(Object value, SessionFactoryImplementor factory) {

hibernate-core/src/main/java/org/hibernate/type/ProcedureParameterExtractionAware.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.sql.CallableStatement;
1010
import java.sql.SQLException;
1111

12-
import org.hibernate.engine.spi.SessionImplementor;
1312
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1413

1514
/**
@@ -40,25 +39,6 @@ public interface ProcedureParameterExtractionAware<T> {
4039
*/
4140
T extract(CallableStatement statement, int startIndex, SharedSessionContractImplementor session) throws SQLException;
4241

43-
/**
44-
* Perform the extraction
45-
*
46-
* @param statement The CallableStatement from which to extract the parameter value(s).
47-
* @param startIndex The parameter index from which to start extracting; assumes the values (if multiple) are contiguous
48-
* @param session The originating session
49-
*
50-
* @return The extracted value.
51-
*
52-
* @throws SQLException Indicates an issue calling into the CallableStatement
53-
* @throws IllegalStateException Thrown if this method is called on instances that return {@code false} for {@link #canDoExtraction}
54-
*
55-
* @deprecated {@link #extract(CallableStatement, int, SharedSessionContractImplementor)} should be used instead.
56-
*/
57-
@Deprecated
58-
default T extract(CallableStatement statement, int startIndex, SessionImplementor session) throws SQLException {
59-
return extract( statement, startIndex, (SharedSessionContractImplementor) session );
60-
}
61-
6242
/**
6343
* Perform the extraction
6444
*
@@ -72,23 +52,4 @@ default T extract(CallableStatement statement, int startIndex, SessionImplemento
7252
* @throws IllegalStateException Thrown if this method is called on instances that return {@code false} for {@link #canDoExtraction}
7353
*/
7454
T extract(CallableStatement statement, String[] paramNames, SharedSessionContractImplementor session) throws SQLException;
75-
76-
/**
77-
* Perform the extraction
78-
*
79-
* @param statement The CallableStatement from which to extract the parameter value(s).
80-
* @param paramNames The parameter names.
81-
* @param session The originating session
82-
*
83-
* @return The extracted value.
84-
*
85-
* @throws SQLException Indicates an issue calling into the CallableStatement
86-
* @throws IllegalStateException Thrown if this method is called on instances that return {@code false} for {@link #canDoExtraction}
87-
*
88-
* @deprecated {@link #extract(CallableStatement, String[], SharedSessionContractImplementor)} should be used instead.
89-
*/
90-
@Deprecated
91-
default T extract(CallableStatement statement, String[] paramNames, SessionImplementor session) throws SQLException {
92-
return extract( statement, paramNames, (SharedSessionContractImplementor) session );
93-
}
9455
}

hibernate-core/src/main/java/org/hibernate/type/ProcedureParameterNamedBinder.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.sql.SQLException;
1111

1212
import org.hibernate.HibernateException;
13-
import org.hibernate.engine.spi.SessionImplementor;
1413
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1514

1615
/**
@@ -42,25 +41,4 @@ public interface ProcedureParameterNamedBinder {
4241
* @throws SQLException An error from the JDBC driver
4342
*/
4443
void nullSafeSet(CallableStatement statement, Object value, String name, SharedSessionContractImplementor session) throws SQLException;
45-
46-
/**
47-
* Bind a value to the JDBC prepared statement, ignoring some columns as dictated by the 'settable' parameter.
48-
* Implementors should handle the possibility of null values.
49-
* Does not support multi-column type
50-
*
51-
* @param statement The CallableStatement to which to bind
52-
* @param value the object to write
53-
* @param name parameter bind name
54-
* @param session The originating session
55-
*
56-
* @throws HibernateException An error from Hibernate
57-
* @throws SQLException An error from the JDBC driver
58-
*
59-
* @deprecated {@link #nullSafeSet(CallableStatement, Object, String, SharedSessionContractImplementor)}
60-
* should be used instead.
61-
*/
62-
@Deprecated
63-
default void nullSafeSet(CallableStatement statement, Object value, String name, SessionImplementor session) throws SQLException {
64-
nullSafeSet( statement, value, name, (SharedSessionContractImplementor) session );
65-
}
6644
}

0 commit comments

Comments
 (0)