Search in sources :

Example 1 with RevisionInfoConfiguration

use of org.hibernate.envers.configuration.internal.RevisionInfoConfiguration in project hibernate-orm by hibernate.

the class EnversServiceImpl method doInitialize.

private void doInitialize(final MetadataImplementor metadata, final MappingCollector mappingCollector, ServiceRegistry serviceRegistry) {
    final ConfigurationService cfgService = serviceRegistry.getService(ConfigurationService.class);
    final Properties properties = new Properties();
    properties.putAll(cfgService.getSettings());
    this.globalConfiguration = new GlobalConfiguration(this, properties);
    final ReflectionManager reflectionManager = metadata.getMetadataBuildingOptions().getReflectionManager();
    final RevisionInfoConfiguration revInfoCfg = new RevisionInfoConfiguration(globalConfiguration);
    final RevisionInfoConfigurationResult revInfoCfgResult = revInfoCfg.configure(metadata, reflectionManager);
    EnversServiceImpl.this.auditEntitiesConfiguration = new AuditEntitiesConfiguration(properties, revInfoCfgResult.getRevisionInfoEntityName(), this);
    this.auditProcessManager = new AuditProcessManager(revInfoCfgResult.getRevisionInfoGenerator());
    this.revisionInfoQueryCreator = revInfoCfgResult.getRevisionInfoQueryCreator();
    this.revisionInfoNumberReader = revInfoCfgResult.getRevisionInfoNumberReader();
    this.modifiedEntityNamesReader = revInfoCfgResult.getModifiedEntityNamesReader();
    this.auditStrategy = initializeAuditStrategy(auditEntitiesConfiguration.getAuditStrategyName(), revInfoCfgResult.getRevisionInfoClass(), revInfoCfgResult.getRevisionInfoTimestampData(), serviceRegistry);
    this.entitiesConfigurations = new EntitiesConfigurator().configure(metadata, serviceRegistry, reflectionManager, mappingCollector, globalConfiguration, auditEntitiesConfiguration, auditStrategy, revInfoCfgResult.getRevisionInfoXmlMapping(), revInfoCfgResult.getRevisionInfoRelationMapping());
}
Also used : GlobalConfiguration(org.hibernate.envers.configuration.internal.GlobalConfiguration) AuditProcessManager(org.hibernate.envers.internal.synchronization.AuditProcessManager) EntitiesConfigurator(org.hibernate.envers.configuration.internal.EntitiesConfigurator) ReflectionManager(org.hibernate.annotations.common.reflection.ReflectionManager) RevisionInfoConfiguration(org.hibernate.envers.configuration.internal.RevisionInfoConfiguration) AuditEntitiesConfiguration(org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration) RevisionInfoConfigurationResult(org.hibernate.envers.configuration.internal.RevisionInfoConfigurationResult) ConfigurationService(org.hibernate.engine.config.spi.ConfigurationService) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)1 ReflectionManager (org.hibernate.annotations.common.reflection.ReflectionManager)1 ConfigurationService (org.hibernate.engine.config.spi.ConfigurationService)1 AuditEntitiesConfiguration (org.hibernate.envers.configuration.internal.AuditEntitiesConfiguration)1 EntitiesConfigurator (org.hibernate.envers.configuration.internal.EntitiesConfigurator)1 GlobalConfiguration (org.hibernate.envers.configuration.internal.GlobalConfiguration)1 RevisionInfoConfiguration (org.hibernate.envers.configuration.internal.RevisionInfoConfiguration)1 RevisionInfoConfigurationResult (org.hibernate.envers.configuration.internal.RevisionInfoConfigurationResult)1 AuditProcessManager (org.hibernate.envers.internal.synchronization.AuditProcessManager)1