Search in sources :

Example 1 with TestSqlRepositoryFactory

use of com.evolveum.midpoint.repo.sql.testing.TestSqlRepositoryFactory in project midpoint by Evolveum.

the class DataSourceTestBeanPostprocessor method postProcessAfterInitialization.

@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (!(bean instanceof RepositoryFactory)) {
        return bean;
    }
    TestSqlRepositoryFactory factory = context.getBean("testSqlRepositoryFactory", TestSqlRepositoryFactory.class);
    SqlRepositoryConfiguration config = factory.getSqlConfiguration();
    if (!config.isUsingH2()) {
        return bean;
    }
    System.out.println("Changing hibernate.hbm2ddl.auto to update");
    LOGGER.info("Changing hibernate.hbm2ddl.auto to update");
    config.setHibernateHbm2ddl("update");
    return bean;
}
Also used : TestSqlRepositoryFactory(com.evolveum.midpoint.repo.sql.testing.TestSqlRepositoryFactory) RepositoryFactory(com.evolveum.midpoint.init.RepositoryFactory) TestSqlRepositoryFactory(com.evolveum.midpoint.repo.sql.testing.TestSqlRepositoryFactory) SqlRepositoryConfiguration(com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration)

Aggregations

RepositoryFactory (com.evolveum.midpoint.init.RepositoryFactory)1 SqlRepositoryConfiguration (com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration)1 TestSqlRepositoryFactory (com.evolveum.midpoint.repo.sql.testing.TestSqlRepositoryFactory)1