Skip to content

Commit

Permalink
HHH-16839 Failing to update a one-to-one lazy association with and en…
Browse files Browse the repository at this point in the history
…abled bytecode enhancement
  • Loading branch information
dreab8 committed Jun 27, 2023
1 parent becb116 commit 1980da7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ private void applyTableUpdateDetails(

if ( attributeAnalysis.includeInLocking() ) {
final boolean includeRestriction = includeInRestriction(
oldValues,
dirtinessChecker,
versionMapping,
versionability,
Expand Down Expand Up @@ -1155,18 +1156,23 @@ else if ( tableUpdateBuilder.getOptimisticLockBindings() != null ) {
}

private static boolean includeInRestriction(
Object[] oldValues,
DirtinessChecker dirtinessChecker,
EntityVersionMapping versionMapping,
boolean[] versionability,
OptimisticLockStyle optimisticLockStyle,
int attributeIndex,
AttributeMapping attributeMapping,
AttributeAnalysis attributeAnalysis) {

if ( optimisticLockStyle == OptimisticLockStyle.VERSION
&& versionMapping != null
&& attributeMapping == versionMapping.getVersionAttribute() ) {
return true;
}
else if ( oldValues == null ) {
return false;
}
else if ( optimisticLockStyle == OptimisticLockStyle.ALL ) {
return versionability[attributeIndex];
}
Expand Down

0 comments on commit 1980da7

Please sign in to comment.