protected Configuration buildEmptyConfiguration() {
Configuration cfg = null;
cfg = new Configuration();
ConnectionDescriptor connection = getConnection();
if(connection.isJndiConncetion()) {
cfg.setProperty("hibernate.connection.datasource", connection.getJndiName());
} else {
cfg.setProperty("hibernate.connection.url", connection.getUrl());
cfg.setProperty("hibernate.connection.password", connection.getPassword());
cfg.setProperty("hibernate.connection.username", connection.getUsername());
cfg.setProperty("hibernate.connection.driver_class", connection.getDriverClass());
}
cfg.setProperty("hibernate.dialect", connection.getDialect());
// Ingres does not support scrollable result set
if ("org.hibernate.dialect.IngresDialect".equals(connection.getDialect())) {
cfg.setProperty("hibernate.jdbc.use_scrollable_resultset", "false");
}
cfg.setProperty("hibernate.cglib.use_reflection_optimizer", "true");
cfg.setProperty("hibernate.show_sql", "false");