public abstract class MapperTemplate extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<String,Class<?>> |
entityClassMap |
protected Class<?> |
mapperClass |
protected MapperResolver |
mapperResolver |
protected Map<String,Method> |
methodMap |
| 构造器和说明 |
|---|
MapperTemplate(Class<?> mapperClass,
MapperResolver mapperResolver) |
| 限定符和类型 | 方法和说明 |
|---|---|
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
|
String |
getDialect() |
Class<?> |
getEntityClass(org.apache.ibatis.mapping.MappedStatement ms)
获取返回值类型 - 实体类型
|
String |
getIDENTITY() |
String |
getIDENTITY(EntityColumn column)
获取IDENTITY值的表达式
|
protected List<org.apache.ibatis.mapping.ParameterMapping> |
getPrimaryKeyParameterMappings(org.apache.ibatis.mapping.MappedStatement ms)
已过时。
4.x版本会移除该方法
|
protected String |
getSeqNextVal(EntityColumn column)
获取序列下个值的表达式
|
String |
getUUID() |
boolean |
isBEFORE() |
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 String |
tableName(Class<?> entityClass,
boolean addDefultAlias)
获取实体的表名
|
protected Class<?> mapperClass
protected MapperResolver mapperResolver
public MapperTemplate(Class<?> mapperClass, MapperResolver mapperResolver)
public String getDialect()
public void addMethodMap(String methodName, Method method)
methodName - method - public String getUUID()
public String getIDENTITY()
public String getIDENTITY(EntityColumn column)
column - public boolean isBEFORE()
public boolean isNotEmpty()
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 void setSqlSource(org.apache.ibatis.mapping.MappedStatement ms)
throws Exception
ms - InvocationTargetExceptionIllegalAccessExceptionExceptionpublic 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 - @Deprecated protected List<org.apache.ibatis.mapping.ParameterMapping> getPrimaryKeyParameterMappings(org.apache.ibatis.mapping.MappedStatement ms)
ms - protected String getSeqNextVal(EntityColumn column)
column - Copyright © 2018. All rights reserved.