Skip to content

Commit 9ef0f0a

Browse files
committed
HHH-18647 Fix insert values check for table group joins
1 parent 121c895 commit 9ef0f0a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,11 +1270,6 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12701270
this
12711271
);
12721272

1273-
if ( !rootTableGroup.getTableReferenceJoins().isEmpty()
1274-
|| !rootTableGroup.getTableGroupJoins().isEmpty() ) {
1275-
throw new HibernateException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1276-
}
1277-
12781273
getFromClauseAccess().registerTableGroup( rootPath, rootTableGroup );
12791274

12801275
final InsertSelectStatement insertStatement = new InsertSelectStatement(
@@ -1290,9 +1285,8 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12901285
rootTableGroup
12911286
);
12921287

1293-
if ( !rootTableGroup.getTableReferenceJoins().isEmpty()
1294-
|| !rootTableGroup.getTableGroupJoins().isEmpty() ) {
1295-
throw new SemanticException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1288+
if ( hasJoins( rootTableGroup ) ) {
1289+
throw new HibernateException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
12961290
}
12971291

12981292
for ( SqmValues sqmValues : sqmStatement.getValuesList() ) {

0 commit comments

Comments
 (0)