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 @@ -1279,11 +1279,6 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12791279 this
12801280 );
12811281
1282- if ( !rootTableGroup .getTableReferenceJoins ().isEmpty ()
1283- || !rootTableGroup .getTableGroupJoins ().isEmpty () ) {
1284- throw new HibernateException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1285- }
1286-
12871282 getFromClauseAccess ().registerTableGroup ( rootPath , rootTableGroup );
12881283
12891284 final InsertSelectStatement insertStatement = new InsertSelectStatement (
@@ -1299,9 +1294,8 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
12991294 rootTableGroup
13001295 );
13011296
1302- if ( !rootTableGroup .getTableReferenceJoins ().isEmpty ()
1303- || !rootTableGroup .getTableGroupJoins ().isEmpty () ) {
1304- throw new SemanticException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
1297+ if ( hasJoins ( rootTableGroup ) ) {
1298+ throw new HibernateException ( "Not expecting multiple table references for an SQM INSERT-SELECT" );
13051299 }
13061300
13071301 for ( SqmValues sqmValues : sqmStatement .getValuesList () ) {
You can’t perform that action at this time.
0 commit comments