diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 88ef71503e41..3d8c03bd80b2 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -2555,7 +2555,8 @@ private T find(Class entityClass, Object primaryKey, LockOptions lockOpti } } - private static void logIgnoringEntityNotFound(Class entityClass, Object primaryKey) { + // Hibernate Reactive calls this + protected static void logIgnoringEntityNotFound(Class entityClass, Object primaryKey) { if ( log.isDebugEnabled() ) { log.ignoringEntityNotFound( entityClass != null ? entityClass.getName(): null, diff --git a/hibernate-core/src/main/java/org/hibernate/loader/internal/IdentifierLoadAccessImpl.java b/hibernate-core/src/main/java/org/hibernate/loader/internal/IdentifierLoadAccessImpl.java index 67a230fc0765..0dde4abaf774 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/internal/IdentifierLoadAccessImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/internal/IdentifierLoadAccessImpl.java @@ -38,6 +38,7 @@ * * @author Steve Ebersole */ +// Hibernate Reactive extends this class: see ReactiveIdentifierLoadAccessImpl public class IdentifierLoadAccessImpl implements IdentifierLoadAccess, JavaType.CoercionContext { private final LoadAccessContext context; private final EntityPersister entityPersister; @@ -85,6 +86,7 @@ public final T getReference(Object id) { return perform( () -> doGetReference( id ) ); } + // Hibernate Reactive overrides this protected T perform(Supplier executor) { final SessionImplementor session = context.getSession(); final CacheMode sessionCacheMode = session.getCacheMode(); @@ -122,6 +124,7 @@ protected T perform(Supplier executor) { } @SuppressWarnings( "unchecked" ) + // Hibernate Reactive overrides this protected T doGetReference(Object id) { final SessionImplementor session = context.getSession(); final EntityMappingType concreteType = entityPersister.resolveConcreteProxyTypeForId( id, session ); @@ -147,7 +150,8 @@ public Optional loadOptional(Object id) { } @SuppressWarnings( "unchecked" ) - protected final T doLoad(Object id) { + // Hibernate Reactive overrides this + protected T doLoad(Object id) { final SessionImplementor session = context.getSession(); Object result; try { @@ -162,7 +166,8 @@ protected final T doLoad(Object id) { return (T) result; } - private Object coerceId(Object id, SessionFactoryImplementor factory) { + // Used by Hibernate Reactive + protected Object coerceId(Object id, SessionFactoryImplementor factory) { if ( isLoadByIdComplianceEnabled( factory ) ) { return id; } @@ -236,4 +241,30 @@ public IdentifierLoadAccess disableFetchProfile(String profileName) { } return this; } + + // Getters for Hibernate Reactive + + protected CacheMode getCacheMode() { + return cacheMode; + } + + protected GraphSemantic getGraphSemantic() { + return graphSemantic; + } + + protected LoadAccessContext getContext() { + return context; + } + + protected EntityPersister getEntityPersister() { + return entityPersister; + } + + protected LockOptions getLockOptions() { + return lockOptions; + } + + public RootGraphImplementor getRootGraph() { + return rootGraph; + } }