Skip to content

Instantly share code, notes, and snippets.

@TheKojuEffect
Last active December 13, 2015 23:59
Show Gist options
  • Save TheKojuEffect/4995699 to your computer and use it in GitHub Desktop.
Save TheKojuEffect/4995699 to your computer and use it in GitHub Desktop.
Hibernate Properties available for configurations.
@Bean
public Properties hibernateProperties() {
Properties properties = new Properties();
properties.put("hibernate.dialect",
"org.hibernate.dialect.MySQL5Dialect");
properties.put("hibernate.show_sql", "true");
properties.put("hibernate.hbm2ddl.auto", "create");
// properties.put("hibernate.connection.driver_class", "org.h2.Driver");
// properties.put("hibernate.connection.url",
// "jdbc:h2:db/test;CIPHER=AES");
// properties.put("hibernate.connection.username", "root");
// properties.put("hibernate.connection.password", "root root");
// properties.put("hibernate.connection.pool_size", "1");
// properties.put("hibernate.format_sql", "true");
// properties.put("hibernate.use_sql_comments", "true");
// properties.put("hibernate.c3p0.min_size", "5");
// properties.put("hibernate.c3p0.max_size", "20");
// properties.put("hibernate.c3p0.timeout", "300");
// properties.put("hibernate.c3p0.max_statements", "50");
// properties.put("hibernate.c3p0.idle_test_period", "3000");
// properties.put("hibernate.cache.use_second_level_cache", "true");
// properties.put("hibernate.cache.region.factory_class",
// "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory");
// properties.put("hibernate.cache.use_query_cache", "true");
// properties.put("hibernate.cache.use_minimal_puts", "true");
// properties.put("hibernate.max_fetch_depth", "10");
return properties;
}
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.hbm2ddl.auto=false
hibernate.use_sql_comments=false
hibernate.generate_statistics=false
javax.persistence.validation.mode=none
org.hibernate.envers.store_data_at_delete=true
org.hibernate.envers.global_with_modified_flag=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment