diff --git a/build.gradle b/build.gradle index 32c9de8fc8..1ad183c3a5 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ version = projectVersion // ./gradlew clean build -PhibernateOrmVersion=5.6.15-SNAPSHOT ext { if ( !project.hasProperty('hibernateOrmVersion') ) { - hibernateOrmVersion = '6.2.4.Final' + hibernateOrmVersion = '6.2.5.Final' } if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) { // Same as ORM as default diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/iternal/ReactiveSimpleDeleteQueryPlan.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/iternal/ReactiveSimpleDeleteQueryPlan.java index 581d62c818..f831d0756f 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/iternal/ReactiveSimpleDeleteQueryPlan.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/iternal/ReactiveSimpleDeleteQueryPlan.java @@ -172,11 +172,8 @@ public MappingModelExpressible getResolvedMappingModelType(SqmParameter reactiveExecute(DomainQueryExecutionContext exe ( (SqlExpressible) count ).getJdbcMapping() ) ); - querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 1, 0, count ) ); + querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 0, count ) ); querySpec.getFromClause().addRoot( new CteTableGroup( new NamedTableReference( diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/cte/ReactiveCteInsertHandler.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/cte/ReactiveCteInsertHandler.java index e2fa30ce40..6455a5f0f7 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/cte/ReactiveCteInsertHandler.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/cte/ReactiveCteInsertHandler.java @@ -224,7 +224,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec if ( !assignsId && entityDescriptor.getGenerator().generatedOnExecution() ) { querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( - 1, 0, SqmInsertStrategyHelper.createRowNumberingExpression( querySpec, @@ -254,7 +253,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec columnNames.add( columnReference.getColumnExpression() ); querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( - 1, 0, columnReference.getQualifier().equals( valuesAlias ) ? columnReference @@ -362,7 +360,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec ); rowsWithSequenceQuery.getSelectClause().addSqlSelection( new SqlSelectionImpl( - 1, 0, rowNumberColumnReference ) @@ -373,7 +370,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec ); rowsWithSequenceQuery.getSelectClause().addSqlSelection( new SqlSelectionImpl( - 2, 1, new SelfRenderingSqlFragmentExpression( fragment ) ) @@ -444,7 +440,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec entityQuery.getFromClause().addRoot( baseTableGroup ); entityQuery.getSelectClause().addSqlSelection( new SqlSelectionImpl( - 1, 0, new BinaryArithmeticExpression( new ColumnReference( @@ -488,7 +483,6 @@ public CompletionStage reactiveExecute(DomainQueryExecutionContext exec final CteColumn cteColumn = cteColumns.get( i ); entityQuery.getSelectClause().addSqlSelection( new SqlSelectionImpl( - i + 1, i, new ColumnReference( "e", @@ -559,7 +553,7 @@ else if ( !assignsId && entityDescriptor.getGenerator().generatedOnExecution() ) final Expression count = createCountStar( factory, sqmConverter ); domainResults .add( new BasicResult<>( 0, null, ( (SqlExpressible) count ).getJdbcMapping() ) ); - querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 1, 0, count ) ); + querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( 0, count ) ); querySpec.getFromClause().addRoot( new CteTableGroup( new NamedTableReference( diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveExecuteWithTemporaryTableHelper.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveExecuteWithTemporaryTableHelper.java index e78ee3fb05..7858236944 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveExecuteWithTemporaryTableHelper.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveExecuteWithTemporaryTableHelper.java @@ -104,15 +104,14 @@ public static CompletionStage saveMatchingIdsIntoIdTable( matchingIdSelection.getFromClause().addRoot( mutatingTableGroup ); mutatingEntityDescriptor.getIdentifierMapping().forEachSelectable( - (jdbcPosition, selection) -> { + (selectionIndex, selection) -> { final TableReference tableReference = mutatingTableGroup.resolveTableReference( mutatingTableGroup.getNavigablePath(), selection.getContainingTableExpression() ); matchingIdSelection.getSelectClause().addSqlSelection( new SqlSelectionImpl( - jdbcPosition, - jdbcPosition + 1, + selectionIndex + 1, sqmConverter.getSqlExpressionResolver().resolveSqlExpression( tableReference, selection @@ -127,7 +126,6 @@ public static CompletionStage saveMatchingIdsIntoIdTable( matchingIdSelection.getSelectClause().addSqlSelection( new SqlSelectionImpl( jdbcPosition, - jdbcPosition + 1, new QueryLiteral<>( UUID.fromString( sessionUidAccess.apply( executionContext.getSession() ) ), (BasicValuedMapping) idTable.getSessionUidColumn().getJdbcMapping() @@ -219,6 +217,7 @@ public static QuerySpec createIdTableSelectQuerySpec( return querySpec; } + // TODO: I think we can reuse the method in ExecuteWithTemporaryTableHelper private static void applyIdTableSelections( QuerySpec querySpec, TableReference tableReference, @@ -232,7 +231,6 @@ private static void applyIdTableSelections( if ( temporaryTableColumn != idTable.getSessionUidColumn() ) { querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( - i + 1, i, new ColumnReference( tableReference, @@ -251,7 +249,6 @@ private static void applyIdTableSelections( (i, selectableMapping) -> { querySpec.getSelectClause().addSqlSelection( new SqlSelectionImpl( - i + 1, i, new ColumnReference( tableReference, diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveUpdateExecutionDelegate.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveUpdateExecutionDelegate.java index eedc1f8a0f..9a66bd8d37 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveUpdateExecutionDelegate.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveUpdateExecutionDelegate.java @@ -273,9 +273,8 @@ private CompletionStage executeInsert( // And transform assignments to target column references and selections for ( Assignment assignment : assignments ) { targetColumnReferences.addAll( assignment.getAssignable().getColumnReferences() ); - insertSourceSelectQuerySpec.getSelectClause().addSqlSelection( - new SqlSelectionImpl( 0, -1, assignment.getAssignedValue() ) - ); + insertSourceSelectQuerySpec.getSelectClause() + .addSqlSelection( new SqlSelectionImpl( assignment.getAssignedValue() ) ); } final InsertSelectStatement insertSqlAst = new InsertSelectStatement( targetTableReference );