1313import java .util .Iterator ;
1414
1515import org .hibernate .HibernateException ;
16- import org .hibernate .engine .spi .SessionImplementor ;
1716import org .hibernate .engine .spi .SharedSessionContractImplementor ;
1817import org .hibernate .loader .CollectionAliases ;
1918import 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}
0 commit comments