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 4f3654e1d1
commit 9a68a9b580
1 changed files with 2 additions and 3 deletions

View File

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