T - 实体类public class MapperFactoryBean<T>
extends org.mybatis.spring.mapper.MapperFactoryBean<T>
Sample configuration:
<bean id="baseMapper" class="org.mybatis.spring.mapper.MapperFactoryBean" abstract="true" lazy-init="true">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
<bean id="oneMapper" parent="baseMapper">
<property name="mapperInterface" value="my.package.MyMapperInterface" />
</bean>
<bean id="anotherMapper" parent="baseMapper">
<property name="mapperInterface" value="my.package.MyAnotherMapperInterface" />
</bean>
Note that this factory can only inject interfaces, not concrete classes.
SqlSessionTemplate| Constructor and Description |
|---|
MapperFactoryBean()
初始化 MapperFactoryBean
|
MapperFactoryBean(Class<T> mapperInterface)
初始化 MapperFactoryBean
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkDaoConfig() |
getMapperInterface, getObject, getObjectType, isAddToConfig, isSingleton, setAddToConfig, setMapperInterfaceprotected void checkDaoConfig()
checkDaoConfig in class org.mybatis.spring.mapper.MapperFactoryBean<T>Copyright © 2018–2019. All rights reserved.