final PersistentClass pc = classes.next();
// Collecting information from annotations on the persistent class pc
final AnnotationsMetadataReader annotationsMetadataReader =
new AnnotationsMetadataReader( globalCfg, reflectionManager, pc );
final ClassAuditingData auditData = annotationsMetadataReader.getAuditData();
classesAuditingData.addClassAuditingData( pc, auditData );
}
// Now that all information is read we can update the calculated fields.
classesAuditingData.updateCalculatedFields();
final AuditMetadataGenerator auditMetaGen = new AuditMetadataGenerator(
cfg, globalCfg, verEntCfg, auditStrategy,
classLoaderService, revisionInfoRelationMapping, auditEntityNameRegister
);
// First pass
for ( Map.Entry<PersistentClass, ClassAuditingData> pcDatasEntry : classesAuditingData.getAllClassAuditedData() ) {
final PersistentClass pc = pcDatasEntry.getKey();
final ClassAuditingData auditData = pcDatasEntry.getValue();
final EntityXmlMappingData xmlMappingData = new EntityXmlMappingData();
if ( auditData.isAudited() ) {
if ( !StringTools.isEmpty( auditData.getAuditTable().value() ) ) {
verEntCfg.addCustomAuditTableName( pc.getEntityName(), auditData.getAuditTable().value() );
}
auditMetaGen.generateFirstPass( pc, auditData, xmlMappingData, true );
}
else {