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
1271
1271
this
1272
1272
);
1273
1273
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
-
1279
1274
getFromClauseAccess ().registerTableGroup ( rootPath , rootTableGroup );
1280
1275
1281
1276
final InsertSelectStatement insertStatement = new InsertSelectStatement (
@@ -1291,9 +1286,8 @@ public InsertStatement visitInsertValuesStatement(SqmInsertValuesStatement<?> sq
1291
1286
rootTableGroup
1292
1287
);
1293
1288
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" );
1297
1291
}
1298
1292
1299
1293
for ( SqmValues sqmValues : sqmStatement .getValuesList () ) {
You can’t perform that action at this time.
0 commit comments