public abstract class MapperTemplate extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Class<?>> |
entityClassMap |
protected Class<?> |
mapperClass |
protected MapperHelper |
mapperHelper |
protected Map<String,Method> |
methodMap |
Constructor and Description |
---|
MapperTemplate(Class<?> mapperClass,
MapperHelper mapperHelper) |
Modifier and Type | Method and Description |
---|---|
void |
addMethodMap(String methodName,
Method method)
添加映射方法
|
org.apache.ibatis.mapping.SqlSource |
createSqlSource(org.apache.ibatis.mapping.MappedStatement ms,
String xmlSql)
通过xmlSql创建sqlSource
|
String |
dynamicSQL(Object record)
该方法仅仅用来初始化ProviderSqlSource
|
Config |
getConfig() |
Class<?> |
getEntityClass(org.apache.ibatis.mapping.MappedStatement ms)
获取返回值类型 - 实体类型
|
String |
getIDENTITY() |
String |
getIDENTITY(EntityColumn column)
获取IDENTITY值的表达式
|
boolean |
isBEFORE() |
boolean |
isCheckExampleEntityClass() |
boolean |
isNotEmpty() |
protected void |
setResultType(org.apache.ibatis.mapping.MappedStatement ms,
Class<?> entityClass)
设置返回值类型 - 为了让typeHandler在select时有效,改为设置resultMap
|
void |
setSqlSource(org.apache.ibatis.mapping.MappedStatement ms)
重新设置SqlSource
|
protected void |
setSqlSource(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource)
重新设置SqlSource
|
boolean |
supportMethod(String msId)
是否支持该通用方法
|
protected String |
tableName(Class<?> entityClass)
获取实体类的表名
|
protected Class<?> mapperClass
protected MapperHelper mapperHelper
public MapperTemplate(Class<?> mapperClass, MapperHelper mapperHelper)
public String dynamicSQL(Object record)
record
- public void addMethodMap(String methodName, Method method)
methodName
- method
- public String getIDENTITY(EntityColumn column)
column
- public boolean supportMethod(String msId)
msId
- protected void setResultType(org.apache.ibatis.mapping.MappedStatement ms, Class<?> entityClass)
ms
- entityClass
- protected void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.mapping.SqlSource sqlSource)
ms
- sqlSource
- public org.apache.ibatis.mapping.SqlSource createSqlSource(org.apache.ibatis.mapping.MappedStatement ms, String xmlSql)
ms
- xmlSql
- public Class<?> getEntityClass(org.apache.ibatis.mapping.MappedStatement ms)
ms
- protected String tableName(Class<?> entityClass)
entityClass
- public Config getConfig()
public String getIDENTITY()
public boolean isBEFORE()
public boolean isCheckExampleEntityClass()
public boolean isNotEmpty()
public void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms) throws Exception
ms
- InvocationTargetException
IllegalAccessException
Exception
Copyright © 2018. All rights reserved.