@@ -263,7 +263,10 @@ private static void bindKeyValue(
263
263
}
264
264
}
265
265
266
- private JdbcDeleteMutation createJdbcDelete (SharedSessionContractImplementor session ) {
266
+ /*
267
+ * Used by Hibernate Reactive
268
+ */
269
+ protected JdbcDeleteMutation createJdbcDelete (SharedSessionContractImplementor session ) {
267
270
final TableDelete tableDelete ;
268
271
if ( tableMapping .getDeleteDetails () != null
269
272
&& tableMapping .getDeleteDetails ().getCustomSql () != null ) {
@@ -305,39 +308,7 @@ private boolean performUpdate(
305
308
JdbcValueBindings jdbcValueBindings ,
306
309
SharedSessionContractImplementor session ) {
307
310
MODEL_MUTATION_LOGGER .tracef ( "#performUpdate(%s)" , tableMapping .getTableName () );
308
-
309
- final TableUpdate <JdbcMutationOperation > tableUpdate ;
310
- if ( tableMapping .getUpdateDetails () != null
311
- && tableMapping .getUpdateDetails ().getCustomSql () != null ) {
312
- tableUpdate = new TableUpdateCustomSql (
313
- new MutatingTableReference ( tableMapping ),
314
- mutationTarget ,
315
- "upsert update for " + mutationTarget .getRolePath (),
316
- valueBindings ,
317
- keyBindings ,
318
- optimisticLockBindings ,
319
- parameters
320
- );
321
- }
322
- else {
323
- tableUpdate = new TableUpdateStandard (
324
- new MutatingTableReference ( tableMapping ),
325
- mutationTarget ,
326
- "upsert update for " + mutationTarget .getRolePath (),
327
- valueBindings ,
328
- keyBindings ,
329
- optimisticLockBindings ,
330
- parameters
331
- );
332
- }
333
-
334
- final SqlAstTranslator <JdbcMutationOperation > translator = session
335
- .getJdbcServices ()
336
- .getJdbcEnvironment ()
337
- .getSqlAstTranslatorFactory ()
338
- .buildModelMutationTranslator ( tableUpdate , session .getFactory () );
339
-
340
- final JdbcMutationOperation jdbcUpdate = translator .translate ( null , MutationQueryOptions .INSTANCE );
311
+ final JdbcMutationOperation jdbcUpdate = createJdbcUpdate ( session );
341
312
342
313
final PreparedStatementGroupSingleTable statementGroup = new PreparedStatementGroupSingleTable ( jdbcUpdate , session );
343
314
final PreparedStatementDetails statementDetails = statementGroup .resolvePreparedStatementDetails ( tableMapping .getTableName () );
@@ -374,6 +345,44 @@ private boolean performUpdate(
374
345
}
375
346
}
376
347
348
+ /*
349
+ * Used by Hibernate Reactive
350
+ */
351
+ protected JdbcMutationOperation createJdbcUpdate (SharedSessionContractImplementor session ) {
352
+ final TableUpdate <JdbcMutationOperation > tableUpdate ;
353
+ if ( tableMapping .getUpdateDetails () != null
354
+ && tableMapping .getUpdateDetails ().getCustomSql () != null ) {
355
+ tableUpdate = new TableUpdateCustomSql (
356
+ new MutatingTableReference ( tableMapping ),
357
+ mutationTarget ,
358
+ "upsert update for " + mutationTarget .getRolePath (),
359
+ valueBindings ,
360
+ keyBindings ,
361
+ optimisticLockBindings ,
362
+ parameters
363
+ );
364
+ }
365
+ else {
366
+ tableUpdate = new TableUpdateStandard (
367
+ new MutatingTableReference ( tableMapping ),
368
+ mutationTarget ,
369
+ "upsert update for " + mutationTarget .getRolePath (),
370
+ valueBindings ,
371
+ keyBindings ,
372
+ optimisticLockBindings ,
373
+ parameters
374
+ );
375
+ }
376
+
377
+ final SqlAstTranslator <JdbcMutationOperation > translator = session
378
+ .getJdbcServices ()
379
+ .getJdbcEnvironment ()
380
+ .getSqlAstTranslatorFactory ()
381
+ .buildModelMutationTranslator ( tableUpdate , session .getFactory () );
382
+
383
+ return translator .translate ( null , MutationQueryOptions .INSTANCE );
384
+ }
385
+
377
386
private void performInsert (JdbcValueBindings jdbcValueBindings , SharedSessionContractImplementor session ) {
378
387
final JdbcInsertMutation jdbcInsert = createJdbcInsert ( session );
379
388
@@ -414,7 +423,10 @@ private void performInsert(JdbcValueBindings jdbcValueBindings, SharedSessionCon
414
423
}
415
424
}
416
425
417
- private JdbcInsertMutation createJdbcInsert (SharedSessionContractImplementor session ) {
426
+ /*
427
+ * Used by Hibernate Reactive
428
+ */
429
+ protected JdbcInsertMutation createJdbcInsert (SharedSessionContractImplementor session ) {
418
430
final TableInsert tableInsert ;
419
431
if ( tableMapping .getInsertDetails () != null
420
432
&& tableMapping .getInsertDetails ().getCustomSql () != null ) {
0 commit comments