Skip to content

Commit ab12b43

Browse files
committed
push down some methods from SessionImplementor to EventSource
just as recommended by the @deprecated tags added in H6 Signed-off-by: Gavin King <[email protected]>
1 parent 681bd09 commit ab12b43

File tree

3 files changed

+6
-51
lines changed

3 files changed

+6
-51
lines changed

hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
import org.hibernate.engine.jdbc.spi.JdbcServices;
3939
import org.hibernate.event.spi.EventManager;
4040
import org.hibernate.event.spi.EventSource;
41-
import org.hibernate.event.spi.MergeContext;
42-
import org.hibernate.event.spi.PersistContext;
4341
import org.hibernate.graph.RootGraph;
4442
import org.hibernate.graph.spi.RootGraphImplementor;
4543
import org.hibernate.jdbc.ReturningWork;
@@ -1130,26 +1128,6 @@ public void forceFlush(EntityKey e) throws HibernateException {
11301128
delegate.forceFlush( e );
11311129
}
11321130

1133-
@Override
1134-
public void merge(String entityName, Object object, MergeContext copiedAlready) throws HibernateException {
1135-
delegate.merge( entityName, object, copiedAlready );
1136-
}
1137-
1138-
@Override
1139-
public void persist(String entityName, Object object, PersistContext createdAlready) throws HibernateException {
1140-
delegate.persist( entityName, object, createdAlready );
1141-
}
1142-
1143-
@Override
1144-
public void persistOnFlush(String entityName, Object object, PersistContext copiedAlready) {
1145-
delegate.persistOnFlush( entityName, object, copiedAlready );
1146-
}
1147-
1148-
@Override
1149-
public void removeOrphanBeforeUpdates(String entityName, Object child) {
1150-
delegate.removeOrphanBeforeUpdates( entityName, child );
1151-
}
1152-
11531131
@Override
11541132
public SessionImplementor getSession() {
11551133
return this;

hibernate-core/src/main/java/org/hibernate/engine/spi/SessionImplementor.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
import org.hibernate.Session;
1212
import org.hibernate.engine.jdbc.LobCreationContext;
1313
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
14-
import org.hibernate.event.spi.MergeContext;
15-
import org.hibernate.event.spi.PersistContext;
16-
import org.hibernate.event.spi.RefreshContext;
1714
import org.hibernate.graph.spi.RootGraphImplementor;
1815
import org.hibernate.persister.entity.EntityPersister;
1916
import org.hibernate.query.spi.QueryImplementor;
@@ -103,30 +100,6 @@ default SessionImplementor getSession() {
103100
*/
104101
void lock(String entityName, Object child, LockOptions lockOptions);
105102

106-
/**
107-
* @deprecated OperationalContext should cover this overload I believe
108-
*/
109-
@Deprecated
110-
void merge(String entityName, Object object, MergeContext copiedAlready) throws HibernateException;
111-
112-
/**
113-
* @deprecated OperationalContext should cover this overload I believe
114-
*/
115-
@Deprecated
116-
void persist(String entityName, Object object, PersistContext createdAlready) throws HibernateException;
117-
118-
/**
119-
* @deprecated OperationalContext should cover this overload I believe
120-
*/
121-
@Deprecated
122-
void persistOnFlush(String entityName, Object object, PersistContext copiedAlready);
123-
124-
/**
125-
* @deprecated OperationalContext should cover this overload I believe
126-
*/
127-
@Deprecated
128-
void removeOrphanBeforeUpdates(String entityName, Object child);
129-
130103
@Override
131104
default SessionImplementor asSessionImplementor() {
132105
return this;

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public interface EventSource extends SessionImplementor {
4242
* Cascade merge an entity instance
4343
*/
4444
void merge(String entityName, Object object, MergeContext copiedAlready) throws HibernateException;
45+
4546
/**
4647
* Cascade persist an entity instance
4748
*/
@@ -51,19 +52,22 @@ public interface EventSource extends SessionImplementor {
5152
* Cascade persist an entity instance during the flush process
5253
*/
5354
void persistOnFlush(String entityName, Object object, PersistContext copiedAlready);
55+
5456
/**
5557
* Cascade refresh an entity instance
5658
*/
5759
void refresh(String entityName, Object object, RefreshContext refreshedAlready) throws HibernateException;
60+
5861
/**
5962
* Cascade delete an entity instance
6063
*/
6164
void delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities);
65+
6266
/**
6367
* A specialized type of deletion for orphan removal that must occur prior to queued inserts and updates.
6468
*/
65-
// TODO: The removeOrphan concept is a temporary "hack" for HHH-6484. This should be removed once action/task
66-
// ordering is improved.
69+
// TODO: The removeOrphan concept is a temporary "hack" for HHH-6484.
70+
// This should be removed once action/task ordering is improved.
6771
void removeOrphanBeforeUpdates(String entityName, Object child);
6872

6973
Object load(String entityName, Object identifier);

0 commit comments

Comments
 (0)