public abstract class MapperTemplate extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Class<?>> |
entityClassMap |
protected MapperBuilder |
mapperBuilder |
protected Class<?> |
mapperClass |
protected Map<String,Method> |
methodMap |
| Constructor and Description |
|---|
MapperTemplate(Class<?> mapperClass,
MapperBuilder mapperBuilder) |
| 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
|
Class<?> |
getEntityClass(org.apache.ibatis.mapping.MappedStatement ms)
获取返回值类型 - 实体类型
|
String |
getIdentity() |
String |
getIDENTITY(EntityColumn column)
获取Identity值的表达式
|
protected String |
getSeqNextVal(EntityColumn column)
获取序列下个值的表达式
|
String |
getUUID() |
boolean |
isBEFORE() |
boolean |
isCheckEntityClass() |
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 MapperBuilder mapperBuilder
public MapperTemplate(Class<?> mapperClass, MapperBuilder mapperBuilder)
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 - 方法IDprotected void setResultType(org.apache.ibatis.mapping.MappedStatement ms,
Class<?> entityClass)
ms - MappedStatemententityClass - 对象protected void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource)
ms - MappedStatementsqlSource - SqlSourcepublic org.apache.ibatis.mapping.SqlSource createSqlSource(org.apache.ibatis.mapping.MappedStatement ms,
String xmlSql)
ms - MappedStatementxmlSql - Stringpublic Class<?> getEntityClass(org.apache.ibatis.mapping.MappedStatement ms)
ms - MappedStatementprotected String getSeqNextVal(EntityColumn column)
column - 列protected String tableName(Class<?> entityClass)
entityClass - 对象public String getIdentity()
public String getUUID()
public boolean isBEFORE()
public boolean isCheckEntityClass()
public boolean isNotEmpty()
public void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms)
ms - MappedStatementCopyright © 2019. All rights reserved.