HHH-18647 Fix insert values check for table group joins

This commit is contained in:
Marco Belladelli 2024-09-25 10:54:32 +02:00
parent 91b18622d5
commit 8a0dab9071
1 changed files with 2 additions and 8 deletions

View File

@ -1280,11 +1280,6 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
this this
); );
if ( !rootTableGroup.getTableReferenceJoins().isEmpty()
|| !rootTableGroup.getTableGroupJoins().isEmpty() ) {
throw new HibernateException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
}
getFromClauseAccess().registerTableGroup( rootPath, rootTableGroup ); getFromClauseAccess().registerTableGroup( rootPath, rootTableGroup );
final InsertSelectStatement insertStatement = new InsertSelectStatement( final InsertSelectStatement insertStatement = new InsertSelectStatement(
@ -1300,9 +1295,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
rootTableGroup rootTableGroup
); );
if ( !rootTableGroup.getTableReferenceJoins().isEmpty() if ( hasJoins( rootTableGroup ) ) {
|| !rootTableGroup.getTableGroupJoins().isEmpty() ) { throw new HibernateException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
throw new SemanticException( "Not expecting multiple table references for an SQM INSERT-SELECT" );
} }
for ( SqmValues sqmValues : sqmStatement.getValuesList() ) { for ( SqmValues sqmValues : sqmStatement.getValuesList() ) {