@@ -397,8 +397,8 @@ public CompletionStage<Void> reactiveDelete(Object entity) {
397397 @ Override
398398 public CompletionStage <Void > reactiveUpdate (Object entity ) {
399399 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 ();
402402 return hibernateLazyInitializer .isUninitialized ()
403403 ? failedFuture ( LOG .uninitializedProxyUpdate ( entity .getClass () ) )
404404 : executeReactiveUpdate ( hibernateLazyInitializer .getImplementation () );
@@ -730,22 +730,21 @@ public <T> CompletionStage<T> reactiveFetch(T association, boolean unproxy) {
730730 return completedFuture ( unproxy ? (T ) initializer .getImplementation () : association );
731731 }
732732 }
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 () ) {
736735 return completedFuture ( association );
737736 }
738737 else {
739738 final ReactiveCollectionPersister collectionDescriptor =
740739 (ReactiveCollectionPersister ) getFactory ().getMappingMetamodel ()
741- .getCollectionDescriptor ( persistentCollection .getRole () );
740+ .getCollectionDescriptor ( collection .getRole () );
742741
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 );
746745 return collectionDescriptor .reactiveInitialize ( key , this )
747746 .whenComplete ( (v , e ) -> {
748- persistentCollection .unsetSession ( this );
747+ collection .unsetSession ( this );
749748 if ( persistenceContext .isLoadFinished () ) {
750749 persistenceContext .clear ();
751750 }
@@ -756,13 +755,11 @@ else if ( association instanceof PersistentCollection ) {
756755 else if ( isPersistentAttributeInterceptable ( association ) ) {
757756 final PersistentAttributeInterceptable interceptable = asPersistentAttributeInterceptable ( association );
758757 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 )
764761 .whenComplete ( (i ,e ) -> {
765- proxyInterceptor .unsetSession ();
762+ lazinessInterceptor .unsetSession ();
766763 if ( persistenceContext .isLoadFinished () ) {
767764 persistenceContext .clear ();
768765 }
@@ -860,7 +857,7 @@ public <R> ReactiveSqmQueryImplementor<R> createReactiveQuery(String queryString
860857 delayedAfterCompletion ();
861858
862859 try {
863- final HqlInterpretation interpretation = interpretHql ( queryString , expectedResultType );
860+ final HqlInterpretation <?> interpretation = interpretHql ( queryString , expectedResultType );
864861 final ReactiveQuerySqmImpl <R > query =
865862 new ReactiveQuerySqmImpl <>( queryString , interpretation , expectedResultType , this );
866863 applyQuerySettingsAndHints ( query );
@@ -973,7 +970,7 @@ private <R> ReactiveSelectionQuery<R> interpretAndCreateSelectionQuery(String hq
973970 delayedAfterCompletion ();
974971
975972 try {
976- final HqlInterpretation interpretation = interpretHql ( hql , resultType );
973+ final HqlInterpretation <?> interpretation = interpretHql ( hql , resultType );
977974 checkSelectionQuery ( hql , interpretation );
978975 return createSelectionQuery ( hql , resultType , interpretation );
979976 }
@@ -983,7 +980,7 @@ private <R> ReactiveSelectionQuery<R> interpretAndCreateSelectionQuery(String hq
983980 }
984981 }
985982
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 ) {
987984 final ReactiveSqmSelectionQueryImpl <R > query =
988985 new ReactiveSqmSelectionQueryImpl <>( hql , interpretation , resultType , this );
989986 if ( resultType != null ) {
0 commit comments