HHH-9194 : Revert HHH-8908 fix

This commit reverts commit d7173eeb3a, except for test cases.
This commit is contained in:
Gail Badner 2014-05-27 17:36:06 -07:00
parent 75a84220d3
commit dbfa5c67e8
4 changed files with 7 additions and 18 deletions

View File

@ -482,7 +482,6 @@ public final class CollectionMetadataGenerator {
new ComponentAuditedPropertiesReader( new ComponentAuditedPropertiesReader(
ModificationStore.FULL, ModificationStore.FULL,
true, // true because the collection is being audited
new AuditedPropertiesReader.ComponentPropertiesSource( reflectionManager, component ), new AuditedPropertiesReader.ComponentPropertiesSource( reflectionManager, component ),
auditData, mainGenerator.getGlobalCfg(), reflectionManager, "" auditData, mainGenerator.getGlobalCfg(), reflectionManager, ""
).read(); ).read();

View File

@ -111,14 +111,8 @@ public final class AnnotationsMetadataReader {
auditData.setDefaultAudited(true); auditData.setDefaultAudited(true);
} }
new AuditedPropertiesReader( new AuditedPropertiesReader(defaultStore, new PersistentClassPropertiesSource(xclass), auditData,
defaultStore, globalCfg, reflectionManager, "").read();
auditData.isAudited(),
new PersistentClassPropertiesSource(xclass),
auditData,
globalCfg,
reflectionManager, ""
).read();
addAuditTable(xclass); addAuditTable(xclass);
addAuditSecondaryTables(xclass); addAuditSecondaryTables(xclass);

View File

@ -49,7 +49,6 @@ import static org.hibernate.envers.tools.Tools.newHashSet;
*/ */
public class AuditedPropertiesReader { public class AuditedPropertiesReader {
protected final ModificationStore defaultStore; protected final ModificationStore defaultStore;
private final boolean defaultAudited;
private final PersistentPropertiesSource persistentPropertiesSource; private final PersistentPropertiesSource persistentPropertiesSource;
private final AuditedPropertiesHolder auditedPropertiesHolder; private final AuditedPropertiesHolder auditedPropertiesHolder;
private final GlobalConfiguration globalCfg; private final GlobalConfiguration globalCfg;
@ -68,14 +67,12 @@ public class AuditedPropertiesReader {
private final Set<XClass> overriddenNotAuditedClasses; private final Set<XClass> overriddenNotAuditedClasses;
public AuditedPropertiesReader(ModificationStore defaultStore, public AuditedPropertiesReader(ModificationStore defaultStore,
boolean defaultAudited,
PersistentPropertiesSource persistentPropertiesSource, PersistentPropertiesSource persistentPropertiesSource,
AuditedPropertiesHolder auditedPropertiesHolder, AuditedPropertiesHolder auditedPropertiesHolder,
GlobalConfiguration globalCfg, GlobalConfiguration globalCfg,
ReflectionManager reflectionManager, ReflectionManager reflectionManager,
String propertyNamePrefix) { String propertyNamePrefix) {
this.defaultStore = defaultStore; this.defaultStore = defaultStore;
this.defaultAudited = defaultAudited;
this.persistentPropertiesSource = persistentPropertiesSource; this.persistentPropertiesSource = persistentPropertiesSource;
this.auditedPropertiesHolder = auditedPropertiesHolder; this.auditedPropertiesHolder = auditedPropertiesHolder;
this.globalCfg = globalCfg; this.globalCfg = globalCfg;
@ -279,7 +276,7 @@ public class AuditedPropertiesReader {
addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties, allClassAudited); addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties, allClassAudited);
addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties, allClassAudited); addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties, allClassAudited);
if(allClassAudited != null || !auditedPropertiesHolder.isEmpty() || defaultAudited) { if(allClassAudited != null || !auditedPropertiesHolder.isEmpty()) {
XClass superclazz = clazz.getSuperclass(); XClass superclazz = clazz.getSuperclass();
if (!clazz.isInterface() && !"java.lang.Object".equals(superclazz.getName())) { if (!clazz.isInterface() && !"java.lang.Object".equals(superclazz.getName())) {
addPropertiesFromClass(superclazz); addPropertiesFromClass(superclazz);
@ -324,8 +321,8 @@ public class AuditedPropertiesReader {
PersistentPropertiesSource componentPropertiesSource = new ComponentPropertiesSource( reflectionManager, propertyValue ); PersistentPropertiesSource componentPropertiesSource = new ComponentPropertiesSource( reflectionManager, propertyValue );
AuditedPropertiesReader audPropReader = new AuditedPropertiesReader( AuditedPropertiesReader audPropReader = new AuditedPropertiesReader(
ModificationStore.FULL, defaultAudited, componentPropertiesSource, componentData, globalCfg, ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg, reflectionManager,
reflectionManager, propertyNamePrefix + MappingTools.createComponentPrefix(embeddedName) propertyNamePrefix + MappingTools.createComponentPrefix(embeddedName)
); );
audPropReader.read(); audPropReader.read();
@ -352,7 +349,7 @@ public class AuditedPropertiesReader {
); );
ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader( ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader(
ModificationStore.FULL, isAudited, componentPropertiesSource, componentData, globalCfg, reflectionManager, ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg, reflectionManager,
propertyNamePrefix + MappingTools.createComponentPrefix( property.getName() ) propertyNamePrefix + MappingTools.createComponentPrefix( property.getName() )
); );
audPropReader.read(); audPropReader.read();

View File

@ -14,12 +14,11 @@ import org.hibernate.envers.configuration.GlobalConfiguration;
public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader { public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
public ComponentAuditedPropertiesReader(ModificationStore defaultStore, public ComponentAuditedPropertiesReader(ModificationStore defaultStore,
boolean defaultAudited,
PersistentPropertiesSource persistentPropertiesSource, PersistentPropertiesSource persistentPropertiesSource,
AuditedPropertiesHolder auditedPropertiesHolder, AuditedPropertiesHolder auditedPropertiesHolder,
GlobalConfiguration globalCfg, ReflectionManager reflectionManager, GlobalConfiguration globalCfg, ReflectionManager reflectionManager,
String propertyNamePrefix) { String propertyNamePrefix) {
super(defaultStore, defaultAudited, persistentPropertiesSource, auditedPropertiesHolder, super(defaultStore, persistentPropertiesSource, auditedPropertiesHolder,
globalCfg, reflectionManager, propertyNamePrefix); globalCfg, reflectionManager, propertyNamePrefix);
} }