File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -702,7 +702,7 @@ protected String addDmlCtes(
702
702
703
703
final Generator identifierGenerator = entityDescriptor .getEntityPersister ().getGenerator ();
704
704
final List <Map .Entry <List <CteColumn >, Assignment >> tableAssignments = assignmentsByTable .get ( rootTableReference );
705
- if ( ( tableAssignments == null || tableAssignments .isEmpty () )
705
+ if ( ! assignsId && ( tableAssignments == null || tableAssignments .isEmpty () )
706
706
&& !identifierGenerator .generatedOnExecution () ) {
707
707
throw new IllegalStateException ( "There must be at least a single root table assignment" );
708
708
}
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ public int execute(ExecutionContext executionContext) {
217
217
);
218
218
219
219
if ( rows != 0 ) {
220
- final EntityPersister persister = entityDescriptor .getEntityPersister ();
220
+ final EntityPersister persister = entityDescriptor .getEntityPersister ();
221
221
final int tableSpan = persister .getTableSpan ();
222
222
final int insertedRows = insertRootTable (
223
223
persister .getTableName ( 0 ),
@@ -316,10 +316,11 @@ private int insertRootTable(
316
316
final EntityPersister entityPersister = entityDescriptor .getEntityPersister ();
317
317
final Generator generator = entityPersister .getGenerator ();
318
318
final List <Assignment > assignments = assignmentsByTable .get ( tableExpression );
319
- if ( ( assignments == null || assignments .isEmpty () )
320
- && !generator .generatedOnExecution ()
321
- && ( !( generator instanceof BulkInsertionCapableIdentifierGenerator )
322
- || ( (BulkInsertionCapableIdentifierGenerator ) generator ).supportsBulkInsertionIdentifierGeneration () ) ) {
319
+ if ( !assignsId
320
+ && (assignments == null || assignments .isEmpty ())
321
+ && !generator .generatedOnExecution ()
322
+ && (!(generator instanceof BulkInsertionCapableIdentifierGenerator )
323
+ || ((BulkInsertionCapableIdentifierGenerator ) generator ).supportsBulkInsertionIdentifierGeneration ()) ) {
323
324
throw new IllegalStateException ( "There must be at least a single root table assignment" );
324
325
}
325
326
You can’t perform that action at this time.
0 commit comments