@@ -138,7 +138,7 @@ static CompletionStage<Object> loadByUniqueKey(
138
138
else {
139
139
return persister
140
140
.reactiveLoadByUniqueKey ( uniqueKeyPropertyName , key , session )
141
- .thenApply ( ukResult -> loadHibernateProxyEntity ( ukResult , session )
141
+ .thenCompose ( ukResult -> loadHibernateProxyEntity ( ukResult , session )
142
142
.thenApply ( targetUK -> {
143
143
persistenceContext .addEntity ( euk , targetUK );
144
144
return targetUK ;
@@ -364,9 +364,9 @@ private static CompletionStage<Object> getIdentifierFromHibernateProxy(
364
364
if ( type .isEntityIdentifierMapping () ) {
365
365
propertyValue = getIdentifier ( (EntityType ) type , propertyValue , (SessionImplementor ) session );
366
366
}
367
- return completedFuture ( propertyValue ) ;
367
+ return propertyValue ;
368
368
}
369
- return nullFuture () ;
369
+ return null ;
370
370
} );
371
371
}
372
372
@@ -409,15 +409,7 @@ else if ( types[i] instanceof CollectionType ) {
409
409
session ,
410
410
owner ,
411
411
copyCache
412
- ).thenCompose ( copy -> {
413
- if ( copy instanceof CompletionStage ) {
414
- return ( (CompletionStage <?>) copy ).thenAccept ( nonStageCopy -> copied [i ] = nonStageCopy );
415
- }
416
- else {
417
- copied [i ] = copy ;
418
- return voidFuture ();
419
- }
420
- } );
412
+ ).thenAccept ( copy -> copied [i ] = copy );
421
413
}
422
414
else if ( types [i ] instanceof EntityType ) {
423
415
return replace (
@@ -427,16 +419,7 @@ else if ( types[i] instanceof EntityType ) {
427
419
session ,
428
420
owner ,
429
421
copyCache
430
- ).thenCompose ( copy -> {
431
- if ( copy instanceof CompletionStage ) {
432
- return ( (CompletionStage <?>) copy )
433
- .thenAccept ( nonStageCopy -> copied [i ] = nonStageCopy );
434
- }
435
- else {
436
- copied [i ] = copy ;
437
- return voidFuture ();
438
- }
439
- } );
422
+ ).thenAccept ( copy -> copied [i ] = copy );
440
423
}
441
424
else {
442
425
final Type type = types [i ];
@@ -474,15 +457,7 @@ else if ( types[i] instanceof CollectionType ) {
474
457
owner ,
475
458
copyCache ,
476
459
foreignKeyDirection
477
- ).thenCompose ( copy -> {
478
- if ( copy instanceof CompletionStage ) {
479
- return ( (CompletionStage <?>) copy ).thenAccept ( nonStageCopy -> copied [i ] = nonStageCopy );
480
- }
481
- else {
482
- copied [i ] = copy ;
483
- return voidFuture ();
484
- }
485
- } );
460
+ ).thenAccept ( copy -> copied [i ] = copy );
486
461
}
487
462
else if ( types [i ] instanceof EntityType ) {
488
463
return replace (
@@ -493,15 +468,7 @@ else if ( types[i] instanceof EntityType ) {
493
468
owner ,
494
469
copyCache ,
495
470
foreignKeyDirection
496
- ).thenCompose ( copy -> {
497
- if ( copy instanceof CompletionStage ) {
498
- return ( (CompletionStage <?>) copy ).thenAccept ( nonStageCopy -> copied [i ] = nonStageCopy );
499
- }
500
- else {
501
- copied [i ] = copy ;
502
- return voidFuture ();
503
- }
504
- } );
471
+ ).thenAccept ( copy -> copied [i ] = copy );
505
472
}
506
473
else {
507
474
copied [i ] = types [i ].replace (
0 commit comments