diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java index 4e21e87d30..6e0df82316 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/CollectionMetadataGenerator.java @@ -482,7 +482,6 @@ public final class CollectionMetadataGenerator { new ComponentAuditedPropertiesReader( ModificationStore.FULL, - true, // true because the collection is being audited new AuditedPropertiesReader.ComponentPropertiesSource( reflectionManager, component ), auditData, mainGenerator.getGlobalCfg(), reflectionManager, "" ).read(); diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java index 866ff899cf..ba384226f3 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AnnotationsMetadataReader.java @@ -111,14 +111,8 @@ public final class AnnotationsMetadataReader { auditData.setDefaultAudited(true); } - new AuditedPropertiesReader( - defaultStore, - auditData.isAudited(), - new PersistentClassPropertiesSource(xclass), - auditData, - globalCfg, - reflectionManager, "" - ).read(); + new AuditedPropertiesReader(defaultStore, new PersistentClassPropertiesSource(xclass), auditData, + globalCfg, reflectionManager, "").read(); addAuditTable(xclass); addAuditSecondaryTables(xclass); diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java index 27a4123c64..02a542f84e 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/AuditedPropertiesReader.java @@ -49,7 +49,6 @@ import static org.hibernate.envers.tools.Tools.newHashSet; */ public class AuditedPropertiesReader { protected final ModificationStore defaultStore; - private final boolean defaultAudited; private final PersistentPropertiesSource persistentPropertiesSource; private final AuditedPropertiesHolder auditedPropertiesHolder; private final GlobalConfiguration globalCfg; @@ -68,14 +67,12 @@ public class AuditedPropertiesReader { private final Set overriddenNotAuditedClasses; public AuditedPropertiesReader(ModificationStore defaultStore, - boolean defaultAudited, PersistentPropertiesSource persistentPropertiesSource, AuditedPropertiesHolder auditedPropertiesHolder, GlobalConfiguration globalCfg, ReflectionManager reflectionManager, String propertyNamePrefix) { this.defaultStore = defaultStore; - this.defaultAudited = defaultAudited; this.persistentPropertiesSource = persistentPropertiesSource; this.auditedPropertiesHolder = auditedPropertiesHolder; this.globalCfg = globalCfg; @@ -279,7 +276,7 @@ public class AuditedPropertiesReader { addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties, allClassAudited); addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties, allClassAudited); - if(allClassAudited != null || !auditedPropertiesHolder.isEmpty() || defaultAudited) { + if(allClassAudited != null || !auditedPropertiesHolder.isEmpty()) { XClass superclazz = clazz.getSuperclass(); if (!clazz.isInterface() && !"java.lang.Object".equals(superclazz.getName())) { addPropertiesFromClass(superclazz); @@ -324,8 +321,8 @@ public class AuditedPropertiesReader { PersistentPropertiesSource componentPropertiesSource = new ComponentPropertiesSource( reflectionManager, propertyValue ); AuditedPropertiesReader audPropReader = new AuditedPropertiesReader( - ModificationStore.FULL, defaultAudited, componentPropertiesSource, componentData, globalCfg, - reflectionManager, propertyNamePrefix + MappingTools.createComponentPrefix(embeddedName) + ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg, reflectionManager, + propertyNamePrefix + MappingTools.createComponentPrefix(embeddedName) ); audPropReader.read(); @@ -352,7 +349,7 @@ public class AuditedPropertiesReader { ); ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader( - ModificationStore.FULL, isAudited, componentPropertiesSource, componentData, globalCfg, reflectionManager, + ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg, reflectionManager, propertyNamePrefix + MappingTools.createComponentPrefix( property.getName() ) ); audPropReader.read(); diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/ComponentAuditedPropertiesReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/ComponentAuditedPropertiesReader.java index b8b9c6f4a6..bcf9b56b37 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/ComponentAuditedPropertiesReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/metadata/reader/ComponentAuditedPropertiesReader.java @@ -14,12 +14,11 @@ import org.hibernate.envers.configuration.GlobalConfiguration; public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader { public ComponentAuditedPropertiesReader(ModificationStore defaultStore, - boolean defaultAudited, PersistentPropertiesSource persistentPropertiesSource, AuditedPropertiesHolder auditedPropertiesHolder, GlobalConfiguration globalCfg, ReflectionManager reflectionManager, String propertyNamePrefix) { - super(defaultStore, defaultAudited, persistentPropertiesSource, auditedPropertiesHolder, + super(defaultStore, persistentPropertiesSource, auditedPropertiesHolder, globalCfg, reflectionManager, propertyNamePrefix); }