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

top.lingkang.mm.transaction.MagicTransactionFactory Maven / Gradle / Ivy

Go to download

mybatis能力扩展框架,兼顾mybatis的mapper.xml编写操作数据库。

The newest version!
package top.lingkang.mm.transaction;

import org.apache.ibatis.session.TransactionIsolationLevel;
import org.apache.ibatis.transaction.Transaction;
import org.apache.ibatis.transaction.TransactionFactory;

import javax.sql.DataSource;
import java.sql.Connection;
import java.util.Properties;

/**
 * @Author lingkang
 * @Date 2024/2/29 13:58
 */
public class MagicTransactionFactory implements TransactionFactory {

    @Override
    public Transaction newTransaction(Connection conn) {
        throw new UnsupportedOperationException("未支持的事务创建,已经交由 mybatis-magic 管理");
    }

    @Override
    public Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit) {
        return new MagicTransaction(dataSource);
    }

    @Override
    public void setProperties(Properties props) {
        // 不操作
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy