File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
hibernate-core/src/main/java/org/hibernate/query/sqm/sql Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff 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 () ) {
You can’t perform that action at this time.
0 commit comments