HHH-8908 : Column of Embedded missing in Audit Table
This commit is contained in:
parent
e0677a1ae1
commit
ce6018563c
|
@ -605,6 +605,7 @@ public final class CollectionMetadataGenerator {
|
|||
final ReflectionManager reflectionManager = mainGenerator.getCfg().getReflectionManager();
|
||||
|
||||
new ComponentAuditedPropertiesReader(
|
||||
true, // TODO: is this correct???
|
||||
ModificationStore.FULL,
|
||||
new AuditedPropertiesReader.ComponentPropertiesSource( reflectionManager, component ),
|
||||
auditData, mainGenerator.getGlobalCfg(), reflectionManager, ""
|
||||
|
|
|
@ -121,6 +121,7 @@ public final class AnnotationsMetadataReader {
|
|||
}
|
||||
|
||||
new AuditedPropertiesReader(
|
||||
auditData.isAudited(),
|
||||
defaultStore,
|
||||
new PersistentClassPropertiesSource( xclass ),
|
||||
auditData,
|
||||
|
|
|
@ -72,6 +72,8 @@ import static org.hibernate.envers.internal.tools.Tools.newHashSet;
|
|||
* @author Lukasz Zuchowski (author at zuchos dot com)
|
||||
*/
|
||||
public class AuditedPropertiesReader {
|
||||
private final boolean defaultAudited;
|
||||
// TODO: can defaultStore be made private?
|
||||
protected final ModificationStore defaultStore;
|
||||
private final PersistentPropertiesSource persistentPropertiesSource;
|
||||
private final AuditedPropertiesHolder auditedPropertiesHolder;
|
||||
|
@ -91,12 +93,14 @@ public class AuditedPropertiesReader {
|
|||
private final Set<XClass> overriddenNotAuditedClasses;
|
||||
|
||||
public AuditedPropertiesReader(
|
||||
boolean defaultAudited,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder,
|
||||
GlobalConfiguration globalCfg,
|
||||
ReflectionManager reflectionManager,
|
||||
String propertyNamePrefix) {
|
||||
this.defaultAudited = defaultAudited;
|
||||
this.defaultStore = defaultStore;
|
||||
this.persistentPropertiesSource = persistentPropertiesSource;
|
||||
this.auditedPropertiesHolder = auditedPropertiesHolder;
|
||||
|
@ -368,7 +372,7 @@ public class AuditedPropertiesReader {
|
|||
allClassAudited
|
||||
);
|
||||
|
||||
if ( allClassAudited != null || !auditedPropertiesHolder.isEmpty() ) {
|
||||
if ( allClassAudited != null || !auditedPropertiesHolder.isEmpty() || defaultAudited ) {
|
||||
final XClass superclazz = clazz.getSuperclass();
|
||||
if ( !clazz.isInterface() && !"java.lang.Object".equals( superclazz.getName() ) ) {
|
||||
addPropertiesFromClass( superclazz );
|
||||
|
@ -432,8 +436,8 @@ public class AuditedPropertiesReader {
|
|||
propertyValue
|
||||
);
|
||||
final AuditedPropertiesReader audPropReader = new AuditedPropertiesReader(
|
||||
ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg, reflectionManager,
|
||||
propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName )
|
||||
defaultAudited, ModificationStore.FULL, componentPropertiesSource, componentData, globalCfg,
|
||||
reflectionManager, propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName )
|
||||
);
|
||||
audPropReader.read();
|
||||
|
||||
|
@ -458,6 +462,7 @@ public class AuditedPropertiesReader {
|
|||
}
|
||||
|
||||
final ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader(
|
||||
isAudited,
|
||||
ModificationStore.FULL,
|
||||
componentPropertiesSource,
|
||||
componentData,
|
||||
|
|
|
@ -38,13 +38,14 @@ import org.hibernate.envers.configuration.internal.GlobalConfiguration;
|
|||
public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
|
||||
|
||||
public ComponentAuditedPropertiesReader(
|
||||
boolean defaultAudited,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder,
|
||||
GlobalConfiguration globalCfg, ReflectionManager reflectionManager,
|
||||
String propertyNamePrefix) {
|
||||
super(
|
||||
defaultStore, persistentPropertiesSource, auditedPropertiesHolder,
|
||||
defaultAudited, defaultStore, persistentPropertiesSource, auditedPropertiesHolder,
|
||||
globalCfg, reflectionManager, propertyNamePrefix
|
||||
);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class MappedSuperclassEmbeddableTest extends BaseEnversJPAFunctionalTestC
|
|||
// Generic Code is read from AUD Table
|
||||
Assert.assertEquals(personLoaded.getGenericCode(), personRev1.getGenericCode());
|
||||
|
||||
// Test Code is NOT read from AUD Table
|
||||
// Test Code is read from AUD Table
|
||||
Assert.assertEquals(personLoaded.getTestCode(), personRev1.getTestCode());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue