HHH-9194 : Revert HHH-8908 fix

This reverts 700a233c41, except for tests.
This commit is contained in:
Gail Badner 2014-05-27 18:07:58 -07:00
parent 85a6015cf9
commit 9afc3d086f
4 changed files with 5 additions and 12 deletions

View File

@ -653,7 +653,6 @@ public final class CollectionMetadataGenerator {
new ComponentAuditedPropertiesReader( new ComponentAuditedPropertiesReader(
context, context,
true, // true because the collection is being audited
auditData, auditData,
new AuditedPropertiesReader.ComponentPropertiesSource( new AuditedPropertiesReader.ComponentPropertiesSource(
context.getClassInfo( embeddableBinding.getAttributeContainer() ), context.getClassInfo( embeddableBinding.getAttributeContainer() ),

View File

@ -69,7 +69,7 @@ public final class AnnotationsMetadataReader {
this.context = context; this.context = context;
} }
private ModificationStore getDefaultAuditedModStore(ClassInfo classInfo) { private ModificationStore getDefaultAudited(ClassInfo classInfo) {
final AnnotationInstance audited = JandexHelper.getSingleAnnotation( final AnnotationInstance audited = JandexHelper.getSingleAnnotation(
classInfo.annotations(), classInfo.annotations(),
EnversDotNames.AUDITED, EnversDotNames.AUDITED,
@ -148,12 +148,11 @@ public final class AnnotationsMetadataReader {
) )
); );
ModificationStore defaultStore = getDefaultAuditedModStore( persistentClassPropertiesSource.getClassInfo() ); ModificationStore defaultStore = getDefaultAudited( persistentClassPropertiesSource.getClassInfo() );
auditData.setDefaultAudited( defaultStore != null ); auditData.setDefaultAudited( defaultStore != null );
new AuditedPropertiesReader( new AuditedPropertiesReader(
context, context,
auditData.isAudited(),
auditData, auditData,
persistentClassPropertiesSource, persistentClassPropertiesSource,
"" ""

View File

@ -80,7 +80,6 @@ import static org.hibernate.envers.internal.tools.Tools.newHashSet;
*/ */
public class AuditedPropertiesReader { public class AuditedPropertiesReader {
private final AuditConfiguration.AuditConfigurationContext context; private final AuditConfiguration.AuditConfigurationContext context;
private final boolean defaultAudited;
// TODO: is AttributeBindingContainer actually needed or is Hierarchical sufficient? // TODO: is AttributeBindingContainer actually needed or is Hierarchical sufficient?
private final PersistentPropertiesSource processedPersistentPropertiesSource; private final PersistentPropertiesSource processedPersistentPropertiesSource;
private final ClassInfo processedClassInfo; private final ClassInfo processedClassInfo;
@ -100,12 +99,10 @@ public class AuditedPropertiesReader {
public AuditedPropertiesReader( public AuditedPropertiesReader(
AuditConfiguration.AuditConfigurationContext context, AuditConfiguration.AuditConfigurationContext context,
boolean defaultAudited,
AuditedPropertiesHolder auditedPropertiesHolder, AuditedPropertiesHolder auditedPropertiesHolder,
PersistentPropertiesSource processedPersistentPropertiesSource, PersistentPropertiesSource processedPersistentPropertiesSource,
String propertyNamePrefix) { String propertyNamePrefix) {
this.context = context; this.context = context;
this.defaultAudited = defaultAudited;
this.auditedPropertiesHolder = auditedPropertiesHolder; this.auditedPropertiesHolder = auditedPropertiesHolder;
this.processedPersistentPropertiesSource = processedPersistentPropertiesSource; this.processedPersistentPropertiesSource = processedPersistentPropertiesSource;
this.processedClassInfo = context.getClassInfo( this.processedClassInfo = context.getClassInfo(
@ -402,7 +399,7 @@ public class AuditedPropertiesReader {
addFromProperties( getAttributeBindings( attributeBindingContainer, "field" ), "field", fieldAccessedPersistentProperties, allClassAudited ); addFromProperties( getAttributeBindings( attributeBindingContainer, "field" ), "field", fieldAccessedPersistentProperties, allClassAudited );
addFromProperties( getAttributeBindings( attributeBindingContainer, "property" ), "property", propertyAccessedPersistentProperties, 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() ) ) { if ( Hierarchical.class.isInstance( attributeBindingContainer.getAttributeContainer() ) ) {
// attributeBindingContainer *should* always be an Hierarchical // attributeBindingContainer *should* always be an Hierarchical
final Hierarchical hierarchical = (Hierarchical) attributeBindingContainer.getAttributeContainer(); final Hierarchical hierarchical = (Hierarchical) attributeBindingContainer.getAttributeContainer();
@ -481,7 +478,7 @@ public class AuditedPropertiesReader {
// propertyValue // propertyValue
// ); // );
// final AuditedPropertiesReader audPropReader = new AuditedPropertiesReader( // final AuditedPropertiesReader audPropReader = new AuditedPropertiesReader(
// defaultAudited, componentPropertiesSource, componentData, globalCfg, reflectionManager, // componentPropertiesSource, componentData, globalCfg, reflectionManager,
// propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName ) // propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName )
// ); // );
// audPropReader.read(); // audPropReader.read();
@ -511,7 +508,6 @@ public class AuditedPropertiesReader {
final ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader( final ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader(
context, context,
isAudited,
componentData, componentData,
componentPropertiesSource, componentPropertiesSource,
propertyNamePrefix + MappingTools.createComponentPrefix( attributeBinding.getAttribute().getName() ) propertyNamePrefix + MappingTools.createComponentPrefix( attributeBinding.getAttribute().getName() )

View File

@ -45,12 +45,11 @@ public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
public ComponentAuditedPropertiesReader( public ComponentAuditedPropertiesReader(
AuditConfiguration.AuditConfigurationContext context, AuditConfiguration.AuditConfigurationContext context,
boolean defaultAudited,
AuditedPropertiesHolder auditedPropertiesHolder, AuditedPropertiesHolder auditedPropertiesHolder,
PersistentPropertiesSource persistentPropertiesSource, PersistentPropertiesSource persistentPropertiesSource,
String propertyNamePrefix) { String propertyNamePrefix) {
super( super(
context, defaultAudited, auditedPropertiesHolder, persistentPropertiesSource, propertyNamePrefix context, auditedPropertiesHolder, persistentPropertiesSource, propertyNamePrefix
); );
} }