File tree Expand file tree Collapse file tree 2 files changed +24
-20
lines changed
hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/cte Expand file tree Collapse file tree 2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 33
33
import org .hibernate .query .sqm .tree .expression .SqmParameter ;
34
34
import org .hibernate .query .sqm .tree .expression .SqmStar ;
35
35
import org .hibernate .reactive .query .sqm .mutation .spi .ReactiveAbstractMutationHandler ;
36
+ import org .hibernate .reactive .session .ReactiveSession ;
36
37
import org .hibernate .reactive .sql .exec .internal .StandardReactiveSelectExecutor ;
37
38
import org .hibernate .reactive .sql .results .spi .ReactiveListResultsConsumer ;
38
39
import org .hibernate .sql .ast .SqlAstTranslator ;
@@ -183,16 +184,18 @@ default CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exe
183
184
executionContext .getQueryOptions ()
184
185
);
185
186
lockOptions .setAliasSpecificLockMode ( explicitDmlTargetAlias , lockMode );
186
- executionContext .getSession ().autoFlushIfRequired ( select .getAffectedTableNames () );
187
-
188
- return StandardReactiveSelectExecutor .INSTANCE .list (
189
- select ,
190
- jdbcParameterBindings ,
191
- SqmJdbcExecutionContextAdapter .omittingLockingAndPaging ( executionContext ),
192
- row -> row [0 ],
193
- ReactiveListResultsConsumer .UniqueSemantic .NONE
194
- )
195
- .thenApply ( list -> ( (Number ) list .get ( 0 ) ).intValue () );
187
+
188
+ return ( (ReactiveSession ) executionContext .getSession () )
189
+ .reactiveAutoFlushIfRequired ( select .getAffectedTableNames () )
190
+ .thenCompose ( v -> StandardReactiveSelectExecutor .INSTANCE .list (
191
+ select ,
192
+ jdbcParameterBindings ,
193
+ SqmJdbcExecutionContextAdapter .omittingLockingAndPaging ( executionContext ),
194
+ row -> row [0 ],
195
+ ReactiveListResultsConsumer .UniqueSemantic .NONE
196
+ )
197
+ .thenApply ( list -> ( (Number ) list .get ( 0 ) ).intValue () )
198
+ );
196
199
}
197
200
198
201
/**
Original file line number Diff line number Diff line change 47
47
import org .hibernate .reactive .logging .impl .Log ;
48
48
import org .hibernate .reactive .logging .impl .LoggerFactory ;
49
49
import org .hibernate .reactive .query .sqm .mutation .internal .ReactiveHandler ;
50
+ import org .hibernate .reactive .session .ReactiveSession ;
50
51
import org .hibernate .reactive .sql .exec .internal .StandardReactiveSelectExecutor ;
51
52
import org .hibernate .reactive .sql .results .spi .ReactiveListResultsConsumer ;
52
53
import org .hibernate .spi .NavigablePath ;
@@ -589,15 +590,15 @@ public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T
589
590
executionContext .getSession ()
590
591
);
591
592
final JdbcOperationQuerySelect select = translator .translate ( jdbcParameterBindings , executionContext .getQueryOptions () );
592
-
593
- executionContext . getSession (). autoFlushIfRequired ( select .getAffectedTableNames () );
594
- return StandardReactiveSelectExecutor .INSTANCE .list (
595
- select ,
596
- jdbcParameterBindings ,
597
- SqmJdbcExecutionContextAdapter .omittingLockingAndPaging ( executionContext ),
598
- row -> row [0 ],
599
- ReactiveListResultsConsumer .UniqueSemantic .NONE
600
- )
601
- .thenApply ( list -> ( (Number ) list .get ( 0 ) ).intValue () );
593
+ return ( ( ReactiveSession ) executionContext . getSession () )
594
+ . reactiveAutoFlushIfRequired ( select .getAffectedTableNames () )
595
+ . thenCompose ( v -> StandardReactiveSelectExecutor .INSTANCE .list (
596
+ select ,
597
+ jdbcParameterBindings ,
598
+ SqmJdbcExecutionContextAdapter .omittingLockingAndPaging ( executionContext ),
599
+ row -> row [0 ],
600
+ ReactiveListResultsConsumer .UniqueSemantic .NONE
601
+ )
602
+ .thenApply ( list -> ( (Number ) list .get ( 0 ) ).intValue () ) );
602
603
}
603
604
}
You can’t perform that action at this time.
0 commit comments