Archived
0
This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mc-core/h2_playermanager/sample-config.groovy

31 lines
1.2 KiB
Groovy

def hibernateProps = new Properties()
hibernateProps.put('hibernate.dialect', 'org.hibernate.dialect.H2Dialect')
hibernateProps.put('hibernate.show_sql', false)
hibernateProps.put('hibernate.hbm2ddl.auto', 'update')
beans {
xmlns([context: 'http://www.springframework.org/schema/context'])
context.'annotation-config'()
context.'component-scan'('base-package': 'mc.core.h2db')
xmlns([jpa: 'http://www.springframework.org/schema/data/jpa'])
jpa.'repositories'('base-package': 'mc.core.h2db.repository')
dataSource(org.springframework.jdbc.datasource.DriverManagerDataSource) {
driverClassName = 'org.h2.Driver'
url = 'jdbc:h2:mem:test;DB_CLOSE_DELAY=-1'
username = 'sa'
password = 's3cReT'
}
entityManagerFactory(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) {
dataSource = ref('dataSource')
persistenceProviderClass = 'org.hibernate.jpa.HibernatePersistenceProvider'
packagesToScan = 'mc.core.h2db.entity'
jpaProperties = hibernateProps
}
transactionManager(org.springframework.orm.jpa.JpaTransactionManager) {
entityManagerFactory = ref('entityManagerFactory')
}
}