public abstract class AbstractDBStyle extends Object implements DBStyle
| 限定符和类型 | 字段和说明 |
|---|---|
protected static AbstractDBStyle |
adbs |
String |
HOLDER_END |
String |
HOLDER_START |
protected KeyWordHandler |
keyWordHandler |
protected String |
lineSeparator |
protected MetadataManager |
metadataManager |
protected NameConversion |
nameConversion |
protected boolean |
offsetStartZero |
String |
STATEMENT_END |
String |
STATEMENT_START |
DB_DB2, DB_H2, DB_MYSQL, DB_ORACLE, DB_POSTGRES, DB_SQLLITE, DB_SQLSERVER, ID_ASSIGN, ID_AUTO, ID_SEQ, OFFSET, ORDER_BY, PAGE_END, PAGE_SIZE| 构造器和说明 |
|---|
AbstractDBStyle() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
appendIdCondition(Class<?> cls)
生成主键条件子句(示例 whrer 1=1 and id=${id})
|
protected String |
appendInsertColumn(Class<?> c,
TableDesc table,
String colName)
生成一个追加在insert into 子句的后面sql(示例:name,)
|
protected String |
appendInsertTemplateColumn(Class<?> c,
TableDesc table,
String fieldName,
String colName)
生成一个追加在insert into 子句的后面sql(示例:name,)
需要判断值是否空,如果为空,则不作插入
|
protected String |
appendInsertTemplateValue(Class<?> c,
TableDesc table,
String fieldName)
生成一个追加在insert into value子句的后面sql(示例:name=${name},)
需要判断值是否空,如果为空,则不作插入
|
protected String |
appendInsertValue(Class<?> c,
TableDesc table,
String fieldName,
String col)
生成一个追加在insert into value子句的后面sql(示例:name=${name},)
|
protected String |
appendSetColumn(Class<?> c,
TableDesc table,
String colName,
String fieldName)
生成一个追加在set子句的后面sql(示例:name=${name},)有Empty判断
|
protected String |
appendSetColumnAbsolute(Class<?> c,
TableDesc table,
String colName,
String fieldName)
生成一个追加在set子句的后面sql(示例:name=${name},)
|
protected String |
appendWhere(Class<?> c,
TableDesc table,
String colName,
String fieldName)
生成一个追加在where子句的后面sql(示例:and name=${name} )
|
protected void |
checkId(Collection colsId,
Collection attrsId,
String clsName) |
String |
genColAssignProperty(String tableName)
生成通用的col=property (示例:age=${age},name=${name}) 含有Empty判断
|
String |
genColAssignPropertyAbsolute(String tableName)
生成通用的col=property (示例:age=${age},name=${name}) 没有Empty判断
|
String |
genColumnList(String table)
根据table生成字段名列表
|
String |
genCondition(String tableName)
生成通用条件语句 含有Empty判断
|
protected String |
genDateAnnotatonSql(DateTemplate t,
Class c,
String col) |
SQLSource |
genDeleteById(Class<?> cls) |
protected SQLSource |
generalInsert(Class<?> cls,
boolean template) |
SQLSource |
genInsert(Class<?> cls) |
SQLSource |
genInsertTemplate(Class<?> cls) |
SQLSource |
genSelectAll(Class<?> cls) |
SQLSource |
genSelectById(Class<?> cls) |
SQLSource |
genSelectByIdForUpdate(Class<?> cls) |
SQLSource |
genSelectByTemplate(Class<?> cls) |
SQLSource |
genSelectCountByTemplate(Class<?> cls) |
SQLSource |
genUpdateAbsolute(Class<?> cls) |
SQLSource |
genUpdateAll(Class<?> cls) |
SQLSource |
genUpdateById(Class<?> cls) |
SQLSource |
genUpdateTemplate(Class<?> cls) |
Set<String> |
getCols(String tableName)
获取字段集合
|
int |
getIdType(Class c,
String idProperty) |
KeyWordHandler |
getKeyWordHandler() |
MetadataManager |
getMetadataManager() |
NameConversion |
getNameConversion() |
protected String |
getOrderBy() |
protected String |
getSelectTemplate(Class<?> cls) |
String |
getSeqValue(String seqName)
通过序列名字返回获取序列值的sql片段
|
String |
getSTATEMENTEND() |
String |
getSTATEMENTSTART() |
protected String |
getTableName(TableDesc desc) |
void |
init(Beetl beetl) |
protected boolean |
isLegalOtherMethod(Method method)
方法是否能用来生成select之外的语句,如update,insert
|
protected boolean |
isLegalSelectMethod(Method method)
方法是否能用来生成select语句
|
protected StringBuilder |
removeComma(StringBuilder sql,
String condition)
去掉逗号后面的加上结束符和条件并换行
|
void |
setKeyWordHandler(KeyWordHandler keyWordHandler) |
void |
setMetadataManager(MetadataManager metadataManager) |
void |
setNameConversion(NameConversion nameConversion) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDBType, getName, getPageSQL, getPageSQLStatement, initPageParaprotected static AbstractDBStyle adbs
protected NameConversion nameConversion
protected MetadataManager metadataManager
public String STATEMENT_START
public String STATEMENT_END
public String HOLDER_START
public String HOLDER_END
protected String lineSeparator
protected KeyWordHandler keyWordHandler
protected boolean offsetStartZero
public String getSTATEMENTSTART()
public String getSTATEMENTEND()
public NameConversion getNameConversion()
getNameConversion 在接口中 DBStylepublic void setNameConversion(NameConversion nameConversion)
setNameConversion 在接口中 DBStylepublic MetadataManager getMetadataManager()
getMetadataManager 在接口中 DBStylepublic void setMetadataManager(MetadataManager metadataManager)
setMetadataManager 在接口中 DBStylepublic SQLSource genSelectById(Class<?> cls)
genSelectById 在接口中 DBStylepublic SQLSource genSelectByIdForUpdate(Class<?> cls)
genSelectByIdForUpdate 在接口中 DBStylepublic SQLSource genSelectByTemplate(Class<?> cls)
genSelectByTemplate 在接口中 DBStylepublic SQLSource genSelectCountByTemplate(Class<?> cls)
genSelectCountByTemplate 在接口中 DBStylepublic SQLSource genDeleteById(Class<?> cls)
genDeleteById 在接口中 DBStylepublic SQLSource genSelectAll(Class<?> cls)
genSelectAll 在接口中 DBStylepublic SQLSource genUpdateById(Class<?> cls)
genUpdateById 在接口中 DBStylepublic SQLSource genUpdateAbsolute(Class<?> cls)
genUpdateAbsolute 在接口中 DBStylepublic SQLSource genUpdateTemplate(Class<?> cls)
genUpdateTemplate 在接口中 DBStylepublic SQLSource genUpdateAll(Class<?> cls)
genUpdateAll 在接口中 DBStylepublic SQLSource genInsertTemplate(Class<?> cls)
genInsertTemplate 在接口中 DBStylepublic String genColumnList(String table)
genColumnList 在接口中 DBStyletable - public String genCondition(String tableName)
genCondition 在接口中 DBStyletableName - public String genColAssignProperty(String tableName)
genColAssignProperty 在接口中 DBStyletableName - public String genColAssignPropertyAbsolute(String tableName)
genColAssignPropertyAbsolute 在接口中 DBStyletableName - protected StringBuilder removeComma(StringBuilder sql, String condition)
sql - protected String appendSetColumnAbsolute(Class<?> c, TableDesc table, String colName, String fieldName)
c - table - fieldName - protected String appendSetColumn(Class<?> c, TableDesc table, String colName, String fieldName)
c - table - fieldName - protected String appendWhere(Class<?> c, TableDesc table, String colName, String fieldName)
c - table - fieldName - protected String appendInsertColumn(Class<?> c, TableDesc table, String colName)
c - table - colName - protected String appendInsertValue(Class<?> c, TableDesc table, String fieldName, String col)
table - fieldName - protected String appendInsertTemplateColumn(Class<?> c, TableDesc table, String fieldName, String colName)
c - table - fieldName - colName - protected String appendInsertTemplateValue(Class<?> c, TableDesc table, String fieldName)
table - fieldName - protected String appendIdCondition(Class<?> cls)
cls - protected boolean isLegalSelectMethod(Method method)
method - protected boolean isLegalOtherMethod(Method method)
method - protected String genDateAnnotatonSql(DateTemplate t, Class c, String col)
protected void checkId(Collection colsId, Collection attrsId, String clsName)
protected String getOrderBy()
public KeyWordHandler getKeyWordHandler()
getKeyWordHandler 在接口中 DBStylepublic void setKeyWordHandler(KeyWordHandler keyWordHandler)
setKeyWordHandler 在接口中 DBStylepublic String getSeqValue(String seqName)
DBStylegetSeqValue 在接口中 DBStyleCopyright © 2018. All rights reserved.