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 @@ -1271,11 +1271,6 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12711271 this
12721272 );
12731273
1274- if ( !rootTableGroup .getTableReferenceJoins ().isEmpty ()
1275- || !rootTableGroup .getTableGroupJoins ().isEmpty () ) {
1276- throw new HibernateException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1277- }
1278-
12791274 getFromClauseAccess ().registerTableGroup ( rootPath , rootTableGroup );
12801275
12811276 final InsertSelectStatement insertStatement = new InsertSelectStatement (
@@ -1291,9 +1286,8 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12911286 rootTableGroup
12921287 );
12931288
1294- if ( !rootTableGroup .getTableReferenceJoins ().isEmpty ()
1295- || !rootTableGroup .getTableGroupJoins ().isEmpty () ) {
1296- throw new SemanticException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1289+ if ( hasJoins ( rootTableGroup ) ) {
1290+ throw new HibernateException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
12971291 }
12981292
12991293 for ( SqmValues sqmValues : sqmStatement .getValuesList () ) {
You can’t perform that action at this time.
0 commit comments