[ENT-1153]: fix merge

This commit is contained in:
Tudor Malene
2017-11-27 16:55:06 +00:00
committed by tudor.malene@gmail.com
parent e8d833c2fe
commit a982bb2ae6
4 changed files with 7 additions and 6 deletions

View File

@ -46,7 +46,8 @@ data class DevModeOptions(val disableCheckpointChecker: Boolean = false)
data class DatabaseConfig(
val initDatabase: Boolean = true,
val serverNameTablePrefix: String = "",
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ,
val schema: String? = null
)
enum class TransactionIsolationLevel {

View File

@ -58,9 +58,9 @@ class HibernateConfiguration(val schemaService: SchemaService, private val datab
.setProperty("hibernate.format_sql", "true")
.setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString())
if (databaseProperties.getProperty("schema") != null) {
if (databaseConfig.schema != null) {
// This property helps 'hibernate.hbm2ddl.auto' to work properly when many schemas have similar table names.
config.setProperty("hibernate.default_schema", databaseProperties.getProperty("schema"))
config.setProperty("hibernate.default_schema", databaseConfig.schema)
}
schemas.forEach { schema ->