Skip to content

Commit 9244600

Browse files
gavinkingDavideD
authored andcommitted
adapt to changes in core to use SharedSessionContractImplementor
instead of EventSource
1 parent fbe2980 commit 9244600

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveAbstractMultiIdEntityLoader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.concurrent.CompletionStage;
1111

1212
import org.hibernate.engine.spi.SessionFactoryImplementor;
13-
import org.hibernate.event.spi.EventSource;
13+
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1414
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
1515
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
1616
import org.hibernate.metamodel.mapping.EntityMappingType;
@@ -50,16 +50,16 @@ public EntityMappingType getLoadable() {
5050
}
5151

5252
@Override
53-
public final <K> CompletionStage<List<T>> reactiveLoad(K[] ids, MultiIdLoadOptions loadOptions, EventSource session) {
53+
public final <K> CompletionStage<List<T>> reactiveLoad(K[] ids, MultiIdLoadOptions loadOptions, SharedSessionContractImplementor session) {
5454
Objects.requireNonNull( ids );
5555

5656
return loadOptions.isOrderReturnEnabled()
5757
? performOrderedMultiLoad( ids, loadOptions, session )
5858
: performUnorderedMultiLoad( ids, loadOptions, session );
5959
}
6060

61-
protected abstract <K> CompletionStage<List<T>> performOrderedMultiLoad(K[] ids, MultiIdLoadOptions loadOptions, EventSource session);
61+
protected abstract <K> CompletionStage<List<T>> performOrderedMultiLoad(K[] ids, MultiIdLoadOptions loadOptions, SharedSessionContractImplementor session);
6262

63-
protected abstract <K> CompletionStage<List<T>> performUnorderedMultiLoad(K[] ids, MultiIdLoadOptions loadOptions, EventSource session);
63+
protected abstract <K> CompletionStage<List<T>> performUnorderedMultiLoad(K[] ids, MultiIdLoadOptions loadOptions, SharedSessionContractImplementor session);
6464

6565
}

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import org.hibernate.engine.spi.EntityKey;
1919
import org.hibernate.engine.spi.PersistenceContext;
2020
import org.hibernate.engine.spi.SessionFactoryImplementor;
21+
import org.hibernate.engine.spi.SharedSessionContractImplementor;
2122
import org.hibernate.engine.spi.SubselectFetch;
22-
import org.hibernate.event.spi.EventSource;
2323
import org.hibernate.loader.ast.internal.LoaderSelectBuilder;
2424
import org.hibernate.loader.ast.internal.MultiIdEntityLoaderArrayParam;
2525
import org.hibernate.loader.ast.internal.MultiKeyLoadLogging;
@@ -82,7 +82,7 @@ public BasicEntityIdentifierMapping getIdentifierMapping() {
8282
protected <K> CompletionStage<List<E>> performOrderedMultiLoad(
8383
K[] ids,
8484
MultiIdLoadOptions loadOptions,
85-
EventSource session) {
85+
SharedSessionContractImplementor session) {
8686
if ( MultiKeyLoadLogging.MULTI_KEY_LOAD_LOGGER.isTraceEnabled() ) {
8787
MultiKeyLoadLogging.MULTI_KEY_LOAD_LOGGER.tracef(
8888
"ReactiveMultiIdEntityLoaderArrayParam#performOrderedMultiLoad - %s",
@@ -227,7 +227,7 @@ protected <K> CompletionStage<List<E>> performOrderedMultiLoad(
227227
protected <K> CompletionStage<List<E>> performUnorderedMultiLoad(
228228
K[] ids,
229229
MultiIdLoadOptions loadOptions,
230-
EventSource session) {
230+
SharedSessionContractImplementor session) {
231231
if ( MultiKeyLoadLogging.MULTI_KEY_LOAD_LOGGER.isTraceEnabled() ) {
232232
MultiKeyLoadLogging.MULTI_KEY_LOAD_LOGGER.tracef(
233233
"ReactiveMultiIdEntityLoaderArrayParam#performUnorderedMultiLoad - %s",
@@ -305,7 +305,7 @@ protected final <R, K> K[] processResolvableEntities(
305305
MultiIdEntityLoaderArrayParam.ResolutionConsumer<R> resolutionConsumer,
306306
MultiIdLoadOptions loadOptions,
307307
LockOptions lockOptions,
308-
EventSource session) {
308+
SharedSessionContractImplementor session) {
309309
if ( !loadOptions.isSessionCheckingEnabled()
310310
&& !loadOptions.isSecondLevelCacheCheckingEnabled() ) {
311311
// we'll load all of them from the database

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderStandard.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.hibernate.engine.spi.SessionFactoryImplementor;
2525
import org.hibernate.engine.spi.SharedSessionContractImplementor;
2626
import org.hibernate.engine.spi.SubselectFetch;
27-
import org.hibernate.event.spi.EventSource;
2827
import org.hibernate.internal.util.collections.CollectionHelper;
2928
import org.hibernate.loader.ast.internal.LoaderSelectBuilder;
3029
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
@@ -75,7 +74,7 @@ public ReactiveMultiIdEntityLoaderStandard(
7574
protected CompletionStage<List<T>> performOrderedMultiLoad(
7675
Object[] ids,
7776
MultiIdLoadOptions loadOptions,
78-
EventSource session) {
77+
SharedSessionContractImplementor session) {
7978
if ( LOG.isTraceEnabled() ) {
8079
LOG.tracef( "#performOrderedMultiLoad(`%s`, ..)", getEntityDescriptor().getEntityName() );
8180
}
@@ -289,7 +288,7 @@ private static <T> List<T> singletonList(Object loaded) {
289288
protected CompletionStage<List<T>> performUnorderedMultiLoad(
290289
Object[] ids,
291290
MultiIdLoadOptions loadOptions,
292-
EventSource session) {
291+
SharedSessionContractImplementor session) {
293292
assert !loadOptions.isOrderReturnEnabled();
294293
assert ids != null;
295294

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/spi/ReactiveMultiIdEntityLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.List;
99
import java.util.concurrent.CompletionStage;
1010

11-
import org.hibernate.event.spi.EventSource;
11+
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1212
import org.hibernate.loader.ast.spi.MultiIdEntityLoader;
1313
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
1414
import org.hibernate.reactive.logging.impl.Log;
@@ -22,9 +22,9 @@
2222
public interface ReactiveMultiIdEntityLoader<T> extends MultiIdEntityLoader<T> {
2323

2424
@Override
25-
default <K> List<T> load(K[] ids, MultiIdLoadOptions options, EventSource session) {
25+
default <K> List<T> load(K[] ids, MultiIdLoadOptions options, SharedSessionContractImplementor session) {
2626
throw make( Log.class, lookup() ).nonReactiveMethodCall( "reactiveLoad" );
2727
}
2828

29-
<K> CompletionStage<List<T>> reactiveLoad(K[] ids, MultiIdLoadOptions options, EventSource session);
29+
<K> CompletionStage<List<T>> reactiveLoad(K[] ids, MultiIdLoadOptions options, SharedSessionContractImplementor session);
3030
}

0 commit comments

Comments
 (0)