All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nbcp.myoql.db.mybatis.MyBatisTransactionManagementConfig.kt Maven / Gradle / Ivy

The newest version!
package nbcp.myoql.db.mybatis


import nbcp.base.utils.SpringUtil
import nbcp.myoql.db.db
import org.springframework.jdbc.datasource.DataSourceTransactionManager
import org.springframework.transaction.PlatformTransactionManager
import org.springframework.transaction.annotation.TransactionManagementConfigurer
import javax.sql.DataSource


/**
 * 依赖配置 app.mybatis.package
 */


open class MyBatisTransactionManagementConfig() : TransactionManagementConfigurer {
    val dataSource: DataSource
    get() {
        return db.sql.getScopeDataSource()!!;
    }

    override fun annotationDrivenTransactionManager(): PlatformTransactionManager {
        return DataSourceTransactionManager(dataSource)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy