@@ -520,39 +520,41 @@ private IntegralDataTypeHolder makeValue() {
520
520
}
521
521
522
522
@ Override
523
- public Object generate (final SharedSessionContractImplementor session , final Object obj ) {
524
- final var statementLogger =
525
- session . getFactory (). getJdbcServices ()
526
- . getSqlStatementLogger ();
527
- final var statsCollector = session . getEventListenerManager ();
528
- return optimizer . generate (
529
- new AccessCallback () {
530
- @ Override
531
- public IntegralDataTypeHolder getNextValue ( ) {
532
- return session . getTransactionCoordinator (). createIsolationDelegate (). delegateWork (
533
- new AbstractReturningWork <>() {
534
- @ Override
535
- public IntegralDataTypeHolder execute ( Connection connection ) throws SQLException {
536
- return nextValue ( connection , statementLogger , statsCollector , session );
537
- }
538
- },
539
- true
540
- );
541
- }
542
- @ Override
543
- public String getTenantIdentifier () {
544
- return session . getTenantIdentifier ();
545
- }
546
- }
547
- );
523
+ public Object generate (final SharedSessionContractImplementor session , final Object object ) {
524
+ return optimizer . generate ( new NextValueCallback ( session ) );
525
+ }
526
+
527
+ private class NextValueCallback
528
+ extends AbstractReturningWork < IntegralDataTypeHolder >
529
+ implements AccessCallback {
530
+ private final SharedSessionContractImplementor session ;
531
+ private NextValueCallback ( SharedSessionContractImplementor session ) {
532
+ this . session = session ;
533
+ }
534
+ @ Override
535
+ public IntegralDataTypeHolder getNextValue () {
536
+ return session . getTransactionCoordinator (). createIsolationDelegate ()
537
+ . delegateWork ( this , true );
538
+ }
539
+ @ Override
540
+ public IntegralDataTypeHolder execute ( Connection connection )
541
+ throws SQLException {
542
+ return nextValue ( connection , session );
543
+ }
544
+ @ Override
545
+ public String getTenantIdentifier () {
546
+ return session . getTenantIdentifier ();
547
+ }
548
548
}
549
549
550
550
private IntegralDataTypeHolder nextValue (
551
551
Connection connection ,
552
- SqlStatementLogger logger ,
553
- SessionEventListenerManager listener ,
554
552
SharedSessionContractImplementor session )
555
- throws SQLException {
553
+ throws SQLException {
554
+ final var logger =
555
+ session .getFactory ().getJdbcServices ()
556
+ .getSqlStatementLogger ();
557
+ final var listener = session .getEventListenerManager ();
556
558
final var value = makeValue ();
557
559
int rows ;
558
560
do {
@@ -636,7 +638,8 @@ private PreparedStatement prepareStatement(
636
638
String sql ,
637
639
SqlStatementLogger logger ,
638
640
SessionEventListenerManager listener ,
639
- SharedSessionContractImplementor session ) throws SQLException {
641
+ SharedSessionContractImplementor session )
642
+ throws SQLException {
640
643
logger .logStatement ( sql , FormatStyle .BASIC .getFormatter () );
641
644
final var eventMonitor = session .getEventMonitor ();
642
645
final var creationEvent = eventMonitor .beginJdbcPreparedStatementCreationEvent ();
@@ -661,7 +664,8 @@ private int executeUpdate(
661
664
PreparedStatement ps ,
662
665
SessionEventListenerManager listener ,
663
666
String sql ,
664
- SharedSessionContractImplementor session ) throws SQLException {
667
+ SharedSessionContractImplementor session )
668
+ throws SQLException {
665
669
final var eventMonitor = session .getEventMonitor ();
666
670
final var executionEvent = eventMonitor .beginJdbcPreparedStatementExecutionEvent ();
667
671
try {
@@ -678,7 +682,8 @@ private ResultSet executeQuery(
678
682
PreparedStatement ps ,
679
683
SessionEventListenerManager listener ,
680
684
String sql ,
681
- SharedSessionContractImplementor session ) throws SQLException {
685
+ SharedSessionContractImplementor session )
686
+ throws SQLException {
682
687
final var eventMonitor = session .getEventMonitor ();
683
688
final var executionEvent = eventMonitor .beginJdbcPreparedStatementExecutionEvent ();
684
689
try {
@@ -784,7 +789,7 @@ public void initialize(SqlStringGenerationContext context) {
784
789
public static void applyConfiguration (
785
790
jakarta .persistence .TableGenerator generatorConfig ,
786
791
BiConsumer <String , String > configurationCollector ) {
787
- configurationCollector .accept ( CONFIG_PREFER_SEGMENT_PER_ENTITY , " true" );
792
+ configurationCollector .accept ( CONFIG_PREFER_SEGMENT_PER_ENTITY , String . valueOf ( true ) );
788
793
789
794
applyIfNotEmpty ( TABLE_PARAM , generatorConfig .table (), configurationCollector );
790
795
applyIfNotEmpty ( CATALOG , generatorConfig .catalog (), configurationCollector );
0 commit comments