Skip to content

Commit

Permalink
[#1658] Upgrade Hibernate ORM to 6.2.5.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD committed Jun 13, 2023
1 parent 2a0bc5f commit fc27961
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,8 @@ public <T> MappingModelExpressible<T> getResolvedMappingModelType(SqmParameter<T
sqmInterpretation.getSqlExpressionResolver(),
factory
);
matchingIdSubQuery.getSelectClause().addSqlSelection( new SqlSelectionImpl(
1,
0,
fkTargetColumnExpression
) );
matchingIdSubQuery.getSelectClause()
.addSqlSelection( new SqlSelectionImpl( 0, fkTargetColumnExpression ) );

matchingIdSubQuery.getFromClause().addRoot(
tableGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ default CompletionStage<Integer> 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
if ( !assignsId && entityDescriptor.getGenerator().generatedOnExecution() ) {
querySpec.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
1,
0,
SqmInsertStrategyHelper.createRowNumberingExpression(
querySpec,
Expand Down Expand Up @@ -254,7 +253,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
columnNames.add( columnReference.getColumnExpression() );
querySpec.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
1,
0,
columnReference.getQualifier().equals( valuesAlias )
? columnReference
Expand Down Expand Up @@ -362,7 +360,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
);
rowsWithSequenceQuery.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
1,
0,
rowNumberColumnReference
)
Expand All @@ -373,7 +370,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
);
rowsWithSequenceQuery.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
2,
1,
new SelfRenderingSqlFragmentExpression( fragment )
)
Expand Down Expand Up @@ -444,7 +440,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
entityQuery.getFromClause().addRoot( baseTableGroup );
entityQuery.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
1,
0,
new BinaryArithmeticExpression(
new ColumnReference(
Expand Down Expand Up @@ -488,7 +483,6 @@ public CompletionStage<Integer> reactiveExecute(DomainQueryExecutionContext exec
final CteColumn cteColumn = cteColumns.get( i );
entityQuery.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
i + 1,
i,
new ColumnReference(
"e",
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,14 @@ public static CompletionStage<Integer> 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
Expand All @@ -127,7 +126,6 @@ public static CompletionStage<Integer> saveMatchingIdsIntoIdTable(
matchingIdSelection.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
jdbcPosition,
jdbcPosition + 1,
new QueryLiteral<>(
UUID.fromString( sessionUidAccess.apply( executionContext.getSession() ) ),
(BasicValuedMapping) idTable.getSessionUidColumn().getJdbcMapping()
Expand Down Expand Up @@ -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,
Expand All @@ -232,7 +231,6 @@ private static void applyIdTableSelections(
if ( temporaryTableColumn != idTable.getSessionUidColumn() ) {
querySpec.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
i + 1,
i,
new ColumnReference(
tableReference,
Expand All @@ -251,7 +249,6 @@ private static void applyIdTableSelections(
(i, selectableMapping) -> {
querySpec.getSelectClause().addSqlSelection(
new SqlSelectionImpl(
i + 1,
i,
new ColumnReference(
tableReference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,8 @@ private CompletionStage<Integer> 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 );
Expand Down

0 comments on commit fc27961

Please sign in to comment.