java.lang.Object
org.springframework.dao.support.DaoSupport
org.mybatis.spring.support.SqlSessionDaoSupport
org.miaixz.bus.starter.mapper.MapperFactoryBean<T>
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<T>,org.springframework.beans.factory.InitializingBean
public class MapperFactoryBean<T>
extends org.mybatis.spring.support.SqlSessionDaoSupport
implements org.springframework.beans.factory.FactoryBean<T>
支持注入MyBatis映射器接口的BeanFactory, 通过sqlessionFactory或者预先配置的sqlessionTemplate来设置
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void返回MyBatis mapper的mapper接口booleanvoidsetMapperInterface(Class<T> mapperInterface) 设置MyBatis mapper的mapper接口Methods inherited from class org.mybatis.spring.support.SqlSessionDaoSupport
createSqlSessionTemplate, getSqlSession, getSqlSessionFactory, getSqlSessionTemplate, setSqlSessionFactory, setSqlSessionTemplateMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
MapperFactoryBean
public MapperFactoryBean() -
MapperFactoryBean
-
-
Method Details
-
checkDaoConfig
protected void checkDaoConfig()- Overrides:
checkDaoConfigin classorg.mybatis.spring.support.SqlSessionDaoSupport
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<T>
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<T>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<T>
-
getMapperInterface
返回MyBatis mapper的mapper接口- Returns:
- the object
-
setMapperInterface
设置MyBatis mapper的mapper接口- Parameters:
mapperInterface- 接口
-