use of com.evolveum.midpoint.repo.sql.util.MidPointNamingStrategy in project midpoint by Evolveum.
the class SpringApplicationContextTest method createSQLSchema.
private void createSQLSchema(String fileName, String dialect) throws Exception {
org.hibernate.cfg.Configuration configuration = new Configuration();
configuration.setNamingStrategy(new MidPointNamingStrategy());
configuration.setProperties(sessionFactory.getHibernateProperties());
sessionFactory.getHibernateProperties().setProperty("hibernate.dialect", dialect);
System.out.println("Dialect: " + sessionFactory.getHibernateProperties().getProperty("hibernate.dialect"));
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.container", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.any", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.embedded", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.enums", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.id", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.other", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.common.type", configuration);
addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.audit", configuration);
// addAnnotatedClasses("com.evolveum.midpoint.repo.sql.data.poc", configuration);
configuration.addPackage("com.evolveum.midpoint.repo.sql.type");
SchemaExport export = new SchemaExport(configuration);
export.setOutputFile(fileName);
export.setDelimiter(";");
export.execute(true, false, false, true);
}
Aggregations