HHH-17221 AssertionError initializing a collection with FetchMode.SUBSELECT and IdClass having only one field

This commit is contained in:
Andrea Boriero 2023-09-18 14:33:30 +02:00 committed by Andrea Boriero
parent 77a53bca9b
commit 2a00a49123
1 changed files with 2 additions and 3 deletions

View File

@ -1148,8 +1148,7 @@ public class LoaderSelectBuilder {
final Expression fkExpression; final Expression fkExpression;
final int jdbcTypeCount = fkDescriptor.getJdbcTypeCount(); if ( !fkDescriptor.isEmbedded() ) {
if ( jdbcTypeCount == 1 ) {
assert fkDescriptor instanceof SimpleForeignKeyDescriptor; assert fkDescriptor instanceof SimpleForeignKeyDescriptor;
final SimpleForeignKeyDescriptor simpleFkDescriptor = (SimpleForeignKeyDescriptor) fkDescriptor; final SimpleForeignKeyDescriptor simpleFkDescriptor = (SimpleForeignKeyDescriptor) fkDescriptor;
final TableReference tableReference = rootTableGroup.resolveTableReference( final TableReference tableReference = rootTableGroup.resolveTableReference(
@ -1163,7 +1162,7 @@ public class LoaderSelectBuilder {
); );
} }
else { else {
final List<ColumnReference> columnReferences = new ArrayList<>( jdbcTypeCount ); final List<ColumnReference> columnReferences = new ArrayList<>( fkDescriptor.getJdbcTypeCount() );
fkDescriptor.forEachSelectable( fkDescriptor.forEachSelectable(
(columnIndex, selection) -> { (columnIndex, selection) -> {
final TableReference tableReference = rootTableGroup.resolveTableReference( final TableReference tableReference = rootTableGroup.resolveTableReference(