38
38
*
39
39
* @author Steve Ebersole
40
40
*/
41
+ // Hibernate Reactive extends this class: see ReactiveIdentifierLoadAccessImpl
41
42
public class IdentifierLoadAccessImpl <T > implements IdentifierLoadAccess <T >, JavaType .CoercionContext {
42
43
private final LoadAccessContext context ;
43
44
private final EntityPersister entityPersister ;
@@ -85,6 +86,7 @@ public final T getReference(Object id) {
85
86
return perform ( () -> doGetReference ( id ) );
86
87
}
87
88
89
+ // Hibernate Reactive overrides this
88
90
protected T perform (Supplier <T > executor ) {
89
91
final SessionImplementor session = context .getSession ();
90
92
final CacheMode sessionCacheMode = session .getCacheMode ();
@@ -122,6 +124,7 @@ protected T perform(Supplier<T> executor) {
122
124
}
123
125
124
126
@ SuppressWarnings ( "unchecked" )
127
+ // Hibernate Reactive overrides this
125
128
protected T doGetReference (Object id ) {
126
129
final SessionImplementor session = context .getSession ();
127
130
final EntityMappingType concreteType = entityPersister .resolveConcreteProxyTypeForId ( id , session );
@@ -147,7 +150,8 @@ public Optional<T> loadOptional(Object id) {
147
150
}
148
151
149
152
@ SuppressWarnings ( "unchecked" )
150
- protected final T doLoad (Object id ) {
153
+ // Hibernate Reactive overrides this
154
+ protected T doLoad (Object id ) {
151
155
final SessionImplementor session = context .getSession ();
152
156
Object result ;
153
157
try {
@@ -162,7 +166,8 @@ protected final T doLoad(Object id) {
162
166
return (T ) result ;
163
167
}
164
168
165
- private Object coerceId (Object id , SessionFactoryImplementor factory ) {
169
+ // Used by Hibernate Reactive
170
+ protected Object coerceId (Object id , SessionFactoryImplementor factory ) {
166
171
if ( isLoadByIdComplianceEnabled ( factory ) ) {
167
172
return id ;
168
173
}
@@ -236,4 +241,30 @@ public IdentifierLoadAccess<T> disableFetchProfile(String profileName) {
236
241
}
237
242
return this ;
238
243
}
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
+ }
239
270
}
0 commit comments