3838 *
3939 * @author Steve Ebersole
4040 */
41+ // Hibernate Reactive extends this class: see ReactiveIdentifierLoadAccessImpl
4142public class IdentifierLoadAccessImpl <T > implements IdentifierLoadAccess <T >, JavaType .CoercionContext {
4243 private final LoadAccessContext context ;
4344 private final EntityPersister entityPersister ;
@@ -85,6 +86,7 @@ public final T getReference(Object id) {
8586 return perform ( () -> doGetReference ( id ) );
8687 }
8788
89+ // Hibernate Reactive overrides this
8890 protected T perform (Supplier <T > executor ) {
8991 final SessionImplementor session = context .getSession ();
9092 final CacheMode sessionCacheMode = session .getCacheMode ();
@@ -122,6 +124,7 @@ protected T perform(Supplier<T> executor) {
122124 }
123125
124126 @ SuppressWarnings ( "unchecked" )
127+ // Hibernate Reactive overrides this
125128 protected T doGetReference (Object id ) {
126129 final SessionImplementor session = context .getSession ();
127130 final EntityMappingType concreteType = entityPersister .resolveConcreteProxyTypeForId ( id , session );
@@ -147,7 +150,8 @@ public Optional<T> loadOptional(Object id) {
147150 }
148151
149152 @ SuppressWarnings ( "unchecked" )
150- protected final T doLoad (Object id ) {
153+ // Hibernate Reactive overrides this
154+ protected T doLoad (Object id ) {
151155 final SessionImplementor session = context .getSession ();
152156 Object result ;
153157 try {
@@ -162,7 +166,8 @@ protected final T doLoad(Object id) {
162166 return (T ) result ;
163167 }
164168
165- private Object coerceId (Object id , SessionFactoryImplementor factory ) {
169+ // Used by Hibernate Reactive
170+ protected Object coerceId (Object id , SessionFactoryImplementor factory ) {
166171 if ( isLoadByIdComplianceEnabled ( factory ) ) {
167172 return id ;
168173 }
@@ -236,4 +241,30 @@ public IdentifierLoadAccess<T> disableFetchProfile(String profileName) {
236241 }
237242 return this ;
238243 }
244+
245+ // Getters for Hibernate Reactive
246+
247+ protected CacheMode getCacheMode () {
248+ return cacheMode ;
249+ }
250+
251+ protected GraphSemantic getGraphSemantic () {
252+ return graphSemantic ;
253+ }
254+
255+ protected LoadAccessContext getContext () {
256+ return context ;
257+ }
258+
259+ protected EntityPersister getEntityPersister () {
260+ return entityPersister ;
261+ }
262+
263+ protected LockOptions getLockOptions () {
264+ return lockOptions ;
265+ }
266+
267+ public RootGraphImplementor <T > getRootGraph () {
268+ return rootGraph ;
269+ }
239270}
0 commit comments