mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 21:24:49 +00:00
HHH-17045 Use dynamic update when row-id is not available
This commit is contained in:
parent
53ffe6eb7c
commit
0da986e055
@ -303,6 +303,7 @@ protected void performUpdate(
|
||||
inclusionChecker,
|
||||
lockingChecker,
|
||||
dirtinessChecker,
|
||||
rowId,
|
||||
forceDynamicUpdate,
|
||||
session
|
||||
);
|
||||
@ -620,6 +621,7 @@ private UpdateValuesAnalysisImpl analyzeUpdateValues(
|
||||
InclusionChecker inclusionChecker,
|
||||
InclusionChecker lockingChecker,
|
||||
InclusionChecker dirtinessChecker,
|
||||
Object rowId,
|
||||
boolean forceDynamicUpdate,
|
||||
SharedSessionContractImplementor session) {
|
||||
final AbstractEntityPersister persister = entityPersister();
|
||||
@ -636,6 +638,7 @@ private UpdateValuesAnalysisImpl analyzeUpdateValues(
|
||||
oldValues,
|
||||
dirtyAttributeIndexes,
|
||||
dirtinessChecker,
|
||||
rowId,
|
||||
forceDynamicUpdate
|
||||
);
|
||||
|
||||
@ -1294,6 +1297,7 @@ public UpdateValuesAnalysisImpl(
|
||||
Object[] oldValues,
|
||||
int[] dirtyAttributeIndexes,
|
||||
InclusionChecker dirtinessChecker,
|
||||
Object rowId,
|
||||
boolean forceDynamicUpdate) {
|
||||
this.values = values;
|
||||
this.dirtyAttributeIndexes = dirtyAttributeIndexes;
|
||||
@ -1340,6 +1344,9 @@ else if ( dirtyAttributeIndexes != null ) {
|
||||
|| entityPersister().optimisticLockStyle() == DIRTY ) {
|
||||
tablesNeedingDynamicUpdate.add( tableMapping );
|
||||
}
|
||||
else if ( rowId == null && entityPersister().getRowIdMapping() != null && tableMapping.isIdentifierTable() ) {
|
||||
tablesNeedingDynamicUpdate.add( tableMapping );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
@ -1619,6 +1626,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