HHH-10468 - Fix Envers global_with_modified_flag to allow override behavior when set to false.
This commit is contained in:
parent
8117588354
commit
03aa47ab76
|
@ -560,8 +560,17 @@ public class AuditedPropertiesReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean checkUsingModifiedFlag(Audited aud) {
|
protected boolean checkUsingModifiedFlag(Audited aud) {
|
||||||
return globalCfg.hasSettingForUsingModifiedFlag() ?
|
// HHH-10468
|
||||||
globalCfg.isGlobalWithModifiedFlag() : aud.withModifiedFlag();
|
if ( globalCfg.hasSettingForUsingModifiedFlag() ) {
|
||||||
|
// HHH-10468
|
||||||
|
// Modify behavior so that if the global setting has been set by user properties, then
|
||||||
|
// the audit behavior should be a disjunction between the global setting and the field
|
||||||
|
// annotation. This allows the annotation to take precedence when the global value is
|
||||||
|
// false and for the global setting to take precedence when true.
|
||||||
|
return globalCfg.isGlobalWithModifiedFlag() || aud.withModifiedFlag();
|
||||||
|
}
|
||||||
|
// no global setting enabled, use the annotation's value only.
|
||||||
|
return aud.withModifiedFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPropertyRelationMappedBy(XProperty property, PropertyAuditingData propertyData) {
|
private void setPropertyRelationMappedBy(XProperty property, PropertyAuditingData propertyData) {
|
||||||
|
|
Loading…
Reference in New Issue