类 MapperHelper
- java.lang.Object
-
- tk.mybatis.mapper.mapperhelper.MapperHelper
-
public class MapperHelper extends Object
处理主要逻辑,最关键的一个类- 作者:
- liuzh
-
-
构造器概要
构造器 构造器 说明 MapperHelper()默认构造方法MapperHelper(Properties properties)带配置的构造方法
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ConfiggetConfig()获取通用Mapper配置MapperTemplategetMapperTemplateByMsId(String msId)根据 msId 获取 MapperTemplatebooleanisExtendCommonMapper(Class<?> mapperInterface)判断接口是否包含通用接口,MapperTemplateisMapperMethod(String msId)判断当前的接口方法是否需要进行拦截voidprocessConfiguration(org.apache.ibatis.session.Configuration configuration)配置完成后,执行下面的操作
处理configuration中全部的MappedStatementvoidprocessConfiguration(org.apache.ibatis.session.Configuration configuration, Class<?> mapperInterface)配置指定的接口voidprocessMappedStatement(org.apache.ibatis.mapping.MappedStatement ms)处理 MappedStatementvoidregisterMapper(Class<?> mapperClass)注册通用Mapper接口voidregisterMapper(String mapperClass)注册通用Mapper接口voidsetConfig(Config config)设置通用Mapper配置voidsetProperties(Properties properties)配置属性voidsetSqlSource(org.apache.ibatis.mapping.MappedStatement ms, MapperTemplate mapperTemplate)重新设置SqlSource
-
-
-
构造器详细资料
-
MapperHelper
public MapperHelper()
默认构造方法
-
MapperHelper
public MapperHelper(Properties properties)
带配置的构造方法- 参数:
properties-
-
-
方法详细资料
-
registerMapper
public void registerMapper(Class<?> mapperClass)
注册通用Mapper接口- 参数:
mapperClass-
-
registerMapper
public void registerMapper(String mapperClass)
注册通用Mapper接口- 参数:
mapperClass-
-
isMapperMethod
public MapperTemplate isMapperMethod(String msId)
判断当前的接口方法是否需要进行拦截- 参数:
msId-- 返回:
-
getMapperTemplateByMsId
public MapperTemplate getMapperTemplateByMsId(String msId)
根据 msId 获取 MapperTemplate- 参数:
msId-- 返回:
-
isExtendCommonMapper
public boolean isExtendCommonMapper(Class<?> mapperInterface)
判断接口是否包含通用接口,- 参数:
mapperInterface-- 返回:
-
processConfiguration
public void processConfiguration(org.apache.ibatis.session.Configuration configuration)
配置完成后,执行下面的操作
处理configuration中全部的MappedStatement- 参数:
configuration-
-
processConfiguration
public void processConfiguration(org.apache.ibatis.session.Configuration configuration, Class<?> mapperInterface)配置指定的接口- 参数:
configuration-mapperInterface-
-
processMappedStatement
public void processMappedStatement(org.apache.ibatis.mapping.MappedStatement ms)
处理 MappedStatement- 参数:
ms-
-
getConfig
public Config getConfig()
获取通用Mapper配置- 返回:
-
setConfig
public void setConfig(Config config)
设置通用Mapper配置- 参数:
config-
-
setProperties
public void setProperties(Properties properties)
配置属性- 参数:
properties-
-
setSqlSource
public void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms, MapperTemplate mapperTemplate)重新设置SqlSource 执行该方法前必须使用isMapperMethod判断,否则msIdCache会空- 参数:
ms-mapperTemplate-
-
-