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 3333import org .hibernate .query .sqm .tree .expression .SqmParameter ;
3434import org .hibernate .query .sqm .tree .expression .SqmStar ;
3535import org .hibernate .reactive .query .sqm .mutation .spi .ReactiveAbstractMutationHandler ;
36+ import org .hibernate .reactive .session .ReactiveSession ;
3637import org .hibernate .reactive .sql .exec .internal .StandardReactiveSelectExecutor ;
3738import org .hibernate .reactive .sql .results .spi .ReactiveListResultsConsumer ;
3839import org .hibernate .sql .ast .SqlAstTranslator ;
@@ -183,16 +184,18 @@ default CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exe
183184 executionContext .getQueryOptions ()
184185 );
185186 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+ );
196199 }
197200
198201 /**
Original file line number Diff line number Diff line change 4747import org .hibernate .reactive .logging .impl .Log ;
4848import org .hibernate .reactive .logging .impl .LoggerFactory ;
4949import org .hibernate .reactive .query .sqm .mutation .internal .ReactiveHandler ;
50+ import org .hibernate .reactive .session .ReactiveSession ;
5051import org .hibernate .reactive .sql .exec .internal .StandardReactiveSelectExecutor ;
5152import org .hibernate .reactive .sql .results .spi .ReactiveListResultsConsumer ;
5253import org .hibernate .spi .NavigablePath ;
@@ -589,15 +590,15 @@ public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T
589590 executionContext .getSession ()
590591 );
591592 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 () ) );
602603 }
603604}
You can’t perform that action at this time.
0 commit comments