@@ -397,8 +397,8 @@ public CompletionStage<Void> reactiveDelete(Object entity) {
397
397
@ Override
398
398
public CompletionStage <Void > reactiveUpdate (Object entity ) {
399
399
checkOpen ();
400
- if ( entity instanceof HibernateProxy ) {
401
- final LazyInitializer hibernateLazyInitializer = ( ( HibernateProxy ) entity ) .getHibernateLazyInitializer ();
400
+ if ( entity instanceof HibernateProxy proxy ) {
401
+ final LazyInitializer hibernateLazyInitializer = proxy .getHibernateLazyInitializer ();
402
402
return hibernateLazyInitializer .isUninitialized ()
403
403
? failedFuture ( LOG .uninitializedProxyUpdate ( entity .getClass () ) )
404
404
: executeReactiveUpdate ( hibernateLazyInitializer .getImplementation () );
@@ -730,22 +730,21 @@ public <T> CompletionStage<T> reactiveFetch(T association, boolean unproxy) {
730
730
return completedFuture ( unproxy ? (T ) initializer .getImplementation () : association );
731
731
}
732
732
}
733
- else if ( association instanceof PersistentCollection ) {
734
- final PersistentCollection <?> persistentCollection = (PersistentCollection <?>) association ;
735
- if ( persistentCollection .wasInitialized () ) {
733
+ else if ( association instanceof PersistentCollection <?> collection ) {
734
+ if ( collection .wasInitialized () ) {
736
735
return completedFuture ( association );
737
736
}
738
737
else {
739
738
final ReactiveCollectionPersister collectionDescriptor =
740
739
(ReactiveCollectionPersister ) getFactory ().getMappingMetamodel ()
741
- .getCollectionDescriptor ( persistentCollection .getRole () );
740
+ .getCollectionDescriptor ( collection .getRole () );
742
741
743
- final Object key = persistentCollection .getKey ();
744
- persistenceContext .addUninitializedCollection ( collectionDescriptor , persistentCollection , key );
745
- persistentCollection .setCurrentSession ( this );
742
+ final Object key = collection .getKey ();
743
+ persistenceContext .addUninitializedCollection ( collectionDescriptor , collection , key );
744
+ collection .setCurrentSession ( this );
746
745
return collectionDescriptor .reactiveInitialize ( key , this )
747
746
.whenComplete ( (v , e ) -> {
748
- persistentCollection .unsetSession ( this );
747
+ collection .unsetSession ( this );
749
748
if ( persistenceContext .isLoadFinished () ) {
750
749
persistenceContext .clear ();
751
750
}
@@ -756,13 +755,11 @@ else if ( association instanceof PersistentCollection ) {
756
755
else if ( isPersistentAttributeInterceptable ( association ) ) {
757
756
final PersistentAttributeInterceptable interceptable = asPersistentAttributeInterceptable ( association );
758
757
final PersistentAttributeInterceptor interceptor = interceptable .$$_hibernate_getInterceptor ();
759
- if ( interceptor instanceof EnhancementAsProxyLazinessInterceptor ) {
760
- final EnhancementAsProxyLazinessInterceptor proxyInterceptor =
761
- (EnhancementAsProxyLazinessInterceptor ) interceptor ;
762
- proxyInterceptor .setSession ( this );
763
- return forceInitialize ( association , null , proxyInterceptor .getIdentifier (), proxyInterceptor .getEntityName (), this )
758
+ if ( interceptor instanceof EnhancementAsProxyLazinessInterceptor lazinessInterceptor ) {
759
+ lazinessInterceptor .setSession ( this );
760
+ return forceInitialize ( association , null , lazinessInterceptor .getIdentifier (), lazinessInterceptor .getEntityName (), this )
764
761
.whenComplete ( (i ,e ) -> {
765
- proxyInterceptor .unsetSession ();
762
+ lazinessInterceptor .unsetSession ();
766
763
if ( persistenceContext .isLoadFinished () ) {
767
764
persistenceContext .clear ();
768
765
}
@@ -860,7 +857,7 @@ public <R> ReactiveSqmQueryImplementor<R> createReactiveQuery(String queryString
860
857
delayedAfterCompletion ();
861
858
862
859
try {
863
- final HqlInterpretation interpretation = interpretHql ( queryString , expectedResultType );
860
+ final HqlInterpretation <?> interpretation = interpretHql ( queryString , expectedResultType );
864
861
final ReactiveQuerySqmImpl <R > query =
865
862
new ReactiveQuerySqmImpl <>( queryString , interpretation , expectedResultType , this );
866
863
applyQuerySettingsAndHints ( query );
@@ -973,7 +970,7 @@ private <R> ReactiveSelectionQuery<R> interpretAndCreateSelectionQuery(String hq
973
970
delayedAfterCompletion ();
974
971
975
972
try {
976
- final HqlInterpretation interpretation = interpretHql ( hql , resultType );
973
+ final HqlInterpretation <?> interpretation = interpretHql ( hql , resultType );
977
974
checkSelectionQuery ( hql , interpretation );
978
975
return createSelectionQuery ( hql , resultType , interpretation );
979
976
}
@@ -983,7 +980,7 @@ private <R> ReactiveSelectionQuery<R> interpretAndCreateSelectionQuery(String hq
983
980
}
984
981
}
985
982
986
- private <R > ReactiveSelectionQuery <R > createSelectionQuery (String hql , Class <R > resultType , HqlInterpretation interpretation ) {
983
+ private <R > ReactiveSelectionQuery <R > createSelectionQuery (String hql , Class <R > resultType , HqlInterpretation <?> interpretation ) {
987
984
final ReactiveSqmSelectionQueryImpl <R > query =
988
985
new ReactiveSqmSelectionQueryImpl <>( hql , interpretation , resultType , this );
989
986
if ( resultType != null ) {
0 commit comments