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

org.apache.ibatis.solon.MybatisAdapter Maven / Gradle / Ivy

There is a newer version: 3.0.0-M4
Show newest version
package org.apache.ibatis.solon;

import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.noear.solon.core.VarHolder;
import org.apache.ibatis.solon.integration.MybatisMapperInterceptor;

import java.lang.reflect.Proxy;

/**
 * 适配器
 *
 * 1.提供 mapperScan 能力
 * 2.生成 factory 的能力
 *
 * @author noear
 * @since 1.5
 * */
public interface MybatisAdapter {

    /**
     * 获取配置器
     */
    Configuration getConfiguration();

    /**
     * 获取会话工厂
     */
    SqlSessionFactory getFactory();


    /**
     * 打开一个会话
     */
    default SqlSession openSession() {
        return getFactory().openSession();
    }


    /**
     * 获取印映代理
     */
     T getMapper(Class mapperClz);


    /**
     * 注入到
     */
    void injectTo(VarHolder varH);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy