mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-17045 Use dynamic update when row-id is not available
This commit is contained in:
parent
efe7ee9809
commit
d09237107e
@ -302,6 +302,7 @@ protected void performUpdate(
|
||||
inclusionChecker,
|
||||
lockingChecker,
|
||||
dirtinessChecker,
|
||||
rowId,
|
||||
forceDynamicUpdate,
|
||||
session
|
||||
);
|
||||
@ -619,6 +620,7 @@ private UpdateValuesAnalysisImpl analyzeUpdateValues(
|
||||
InclusionChecker inclusionChecker,
|
||||
InclusionChecker lockingChecker,
|
||||
InclusionChecker dirtinessChecker,
|
||||
Object rowId,
|
||||
boolean forceDynamicUpdate,
|
||||
SharedSessionContractImplementor session) {
|
||||
final AbstractEntityPersister persister = entityPersister();
|
||||
@ -635,6 +637,7 @@ private UpdateValuesAnalysisImpl analyzeUpdateValues(
|
||||
oldValues,
|
||||
dirtyAttributeIndexes,
|
||||
dirtinessChecker,
|
||||
rowId,
|
||||
forceDynamicUpdate
|
||||
);
|
||||
|
||||
@ -1291,6 +1294,7 @@ public UpdateValuesAnalysisImpl(
|
||||
Object[] oldValues,
|
||||
int[] dirtyAttributeIndexes,
|
||||
InclusionChecker dirtinessChecker,
|
||||
Object rowId,
|
||||
boolean forceDynamicUpdate) {
|
||||
this.values = values;
|
||||
this.dirtyAttributeIndexes = dirtyAttributeIndexes;
|
||||
@ -1337,6 +1341,9 @@ else if ( dirtyAttributeIndexes != null ) {
|
||||
|| entityPersister().optimisticLockStyle() == DIRTY ) {
|
||||
tablesNeedingDynamicUpdate.add( tableMapping );
|
||||
}
|
||||
else if ( rowId == null && entityPersister().getRowIdMapping() != null && tableMapping.isIdentifierTable() ) {
|
||||
tablesNeedingDynamicUpdate.add( tableMapping );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
@ -1616,6 +1623,7 @@ private MutationOperationGroup buildStaticUpdateGroup() {
|
||||
}
|
||||
},
|
||||
(index,attribute) -> true,
|
||||
"", // pass anything here to generate the row id restriction if possible
|
||||
false,
|
||||
null
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user