diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/CollectionMetadataGenerator.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/CollectionMetadataGenerator.java index 5ebb5edbe1..21e1447094 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/CollectionMetadataGenerator.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/CollectionMetadataGenerator.java @@ -653,7 +653,6 @@ public final class CollectionMetadataGenerator { new ComponentAuditedPropertiesReader( context, - true, // true because the collection is being audited auditData, new AuditedPropertiesReader.ComponentPropertiesSource( context.getClassInfo( embeddableBinding.getAttributeContainer() ), diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AnnotationsMetadataReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AnnotationsMetadataReader.java index c026b0d24c..402171a768 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AnnotationsMetadataReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AnnotationsMetadataReader.java @@ -69,7 +69,7 @@ public final class AnnotationsMetadataReader { this.context = context; } - private ModificationStore getDefaultAuditedModStore(ClassInfo classInfo) { + private ModificationStore getDefaultAudited(ClassInfo classInfo) { final AnnotationInstance audited = JandexHelper.getSingleAnnotation( classInfo.annotations(), EnversDotNames.AUDITED, @@ -148,12 +148,11 @@ public final class AnnotationsMetadataReader { ) ); - ModificationStore defaultStore = getDefaultAuditedModStore( persistentClassPropertiesSource.getClassInfo() ); + ModificationStore defaultStore = getDefaultAudited( persistentClassPropertiesSource.getClassInfo() ); auditData.setDefaultAudited( defaultStore != null ); new AuditedPropertiesReader( context, - auditData.isAudited(), auditData, persistentClassPropertiesSource, "" diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AuditedPropertiesReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AuditedPropertiesReader.java index 53b41484cb..cafa7de2c6 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AuditedPropertiesReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/AuditedPropertiesReader.java @@ -80,7 +80,6 @@ import static org.hibernate.envers.internal.tools.Tools.newHashSet; */ public class AuditedPropertiesReader { private final AuditConfiguration.AuditConfigurationContext context; - private final boolean defaultAudited; // TODO: is AttributeBindingContainer actually needed or is Hierarchical sufficient? private final PersistentPropertiesSource processedPersistentPropertiesSource; private final ClassInfo processedClassInfo; @@ -100,12 +99,10 @@ public class AuditedPropertiesReader { public AuditedPropertiesReader( AuditConfiguration.AuditConfigurationContext context, - boolean defaultAudited, AuditedPropertiesHolder auditedPropertiesHolder, PersistentPropertiesSource processedPersistentPropertiesSource, String propertyNamePrefix) { this.context = context; - this.defaultAudited = defaultAudited; this.auditedPropertiesHolder = auditedPropertiesHolder; this.processedPersistentPropertiesSource = processedPersistentPropertiesSource; this.processedClassInfo = context.getClassInfo( @@ -402,7 +399,7 @@ public class AuditedPropertiesReader { addFromProperties( getAttributeBindings( attributeBindingContainer, "field" ), "field", fieldAccessedPersistentProperties, allClassAudited ); addFromProperties( getAttributeBindings( attributeBindingContainer, "property" ), "property", propertyAccessedPersistentProperties, allClassAudited ); - if ( allClassAudited != null || !auditedPropertiesHolder.isEmpty() || defaultAudited ) { + if ( allClassAudited != null || !auditedPropertiesHolder.isEmpty() ) { if ( Hierarchical.class.isInstance( attributeBindingContainer.getAttributeContainer() ) ) { // attributeBindingContainer *should* always be an Hierarchical final Hierarchical hierarchical = (Hierarchical) attributeBindingContainer.getAttributeContainer(); @@ -481,7 +478,7 @@ public class AuditedPropertiesReader { // propertyValue // ); // final AuditedPropertiesReader audPropReader = new AuditedPropertiesReader( -// defaultAudited, componentPropertiesSource, componentData, globalCfg, reflectionManager, +// componentPropertiesSource, componentData, globalCfg, reflectionManager, // propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName ) // ); // audPropReader.read(); @@ -511,7 +508,6 @@ public class AuditedPropertiesReader { final ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader( context, - isAudited, componentData, componentPropertiesSource, propertyNamePrefix + MappingTools.createComponentPrefix( attributeBinding.getAttribute().getName() ) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/ComponentAuditedPropertiesReader.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/ComponentAuditedPropertiesReader.java index 2647f605a0..969081a2be 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/ComponentAuditedPropertiesReader.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/reader/ComponentAuditedPropertiesReader.java @@ -45,12 +45,11 @@ public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader { public ComponentAuditedPropertiesReader( AuditConfiguration.AuditConfigurationContext context, - boolean defaultAudited, AuditedPropertiesHolder auditedPropertiesHolder, PersistentPropertiesSource persistentPropertiesSource, String propertyNamePrefix) { super( - context, defaultAudited, auditedPropertiesHolder, persistentPropertiesSource, propertyNamePrefix + context, auditedPropertiesHolder, persistentPropertiesSource, propertyNamePrefix ); }