From 75a84220d3ca8728e31a128831560f0d538f8da9 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Mon, 19 May 2014 14:55:18 -0700 Subject: [PATCH] HHH-9204 HHH-9205 : Restore AbstractCollectionPersister.doProcessQueuedOps() removed by HHH-9078; deprecate method added by HHH-9078 (cherry picked from commit 420296fd267c8bcf9501896fcc17446c55b1d272) Conflicts: hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java --- .../AbstractCollectionPersister.java | 24 ++++++++++++++++--- .../collection/BasicCollectionPersister.java | 3 +-- .../collection/OneToManyPersister.java | 6 ++--- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java index 0ab1429001..47ed49520f 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java @@ -1639,9 +1639,27 @@ public abstract class AbstractCollectionPersister doProcessQueuedOps( collection, key, nextIndex, session ); } } - - protected abstract void doProcessQueuedOps(PersistentCollection collection, Serializable key, - int nextIndex, SessionImplementor session) throws HibernateException; + + /** + * Process queued operations within the PersistentCollection. + * + * @param collection The collection + * @param key The collection key + * @param nextIndex The next index to write + * @param session The session + * @throws HibernateException + * + * @deprecated Use {@link #doProcessQueuedOps(org.hibernate.collection.spi.PersistentCollection, java.io.Serializable, org.hibernate.engine.spi.SessionImplementor)} + */ + @Deprecated + protected void doProcessQueuedOps(PersistentCollection collection, Serializable key, + int nextIndex, SessionImplementor session) + throws HibernateException { + doProcessQueuedOps( collection, key, session ); + } + + protected abstract void doProcessQueuedOps(PersistentCollection collection, Serializable key, SessionImplementor session) + throws HibernateException; public CollectionMetadata getCollectionMetadata() { return this; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/BasicCollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/BasicCollectionPersister.java index 9967c41a14..4778bb733e 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/BasicCollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/BasicCollectionPersister.java @@ -154,8 +154,7 @@ public class BasicCollectionPersister extends AbstractCollectionPersister { } @Override - protected void doProcessQueuedOps(PersistentCollection collection, Serializable id, - int nextIndex, SessionImplementor session) + protected void doProcessQueuedOps(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException { // nothing to do } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java index cd9b7a34a3..144801195c 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/OneToManyPersister.java @@ -192,9 +192,9 @@ public class OneToManyPersister extends AbstractCollectionPersister { } @Override - protected void doProcessQueuedOps(PersistentCollection collection, Serializable id, - int nextIndex, SessionImplementor session) throws HibernateException { - writeIndex( collection, collection.queuedAdditionIterator(), id, nextIndex, session ); + protected void doProcessQueuedOps(PersistentCollection collection, Serializable id, SessionImplementor session) + throws HibernateException { + writeIndex( collection, collection.queuedAdditionIterator(), id, getSize( id, session ), session ); } private void writeIndex(PersistentCollection collection, Iterator entries, Serializable id,