类 AbstractDialect
java.lang.Object
cn.featherfly.common.db.dialect.AbstractDialect
- 所有已实现的接口:
Dialect
- 直接已知子类:
MySQLDialect,OracleDialect,PostgreSQLDialect,SQLiteDialect
public abstract class AbstractDialect extends java.lang.Object implements Dialect
数据库方言的抽象类. 实现了一些通用内容.
-
嵌套类概要
从接口继承的嵌套类/接口 cn.featherfly.common.db.dialect.Dialect
Dialect.Keyworld -
字段概要
字段 修饰符和类型 字段 说明 protected org.slf4j.LoggerloggerThe logger.protected static java.lang.StringUPDATE_STRINGfor update的后置.从接口继承的字段 cn.featherfly.common.db.dialect.Dialect
DEFAULT_LIMIT, LIMIT_PARAM_NAME, PARAM_NAME_START_SYMBOL, PRIMARY_KEY_INDEX_NAME, START_PARAM_NAME -
构造器概要
构造器 构造器 说明 AbstractDialect()Instantiates a new abstract dialect. -
方法概要
修饰符和类型 方法 说明 protected java.lang.StringbuildAddColumnDDL(Column... columns)Builds the add column DDL.java.lang.StringbuildAlterTableAddColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table add column DDL.java.lang.StringbuildAlterTableDDL(java.lang.String schema, java.lang.String tableName, Column[] addColumns, Column[] modifyColumns, Column[] dropColumns)Builds the alter table DDL.java.lang.StringbuildAlterTableDropColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table drop column DDL.java.lang.StringbuildAlterTableDropColumnDDL(java.lang.String schema, java.lang.String tableName, java.lang.String... columnNames)Builds the alter table drop column DDL.java.lang.StringbuildAlterTableModifyColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table modify column DDL.java.lang.StringbuildCreateTableDDL(Table table)Builds the create table sql.protected java.lang.StringbuildDropColumnDDL(Column... columns)Builds the drop column DDL.protected java.lang.StringbuildDropColumnDDL(java.lang.String... columnNames)Builds the drop column DDL.protected java.lang.StringbuildModifyColumnDDL(Column... columns)Builds the modify column DDL.protected abstract java.lang.StringconvertValueToSql(java.lang.Object value, int sqlType)转换值为字符串protected abstract java.lang.StringgetAutoIncrement(Column column)Gets the identity.protected java.lang.StringgetColumnComment(Column column)Gets the column comment.protected java.lang.StringgetColumnDDL(Column column)Gets the column DDL.protected java.lang.StringgetColumnNotNull(Column column)Gets the column not null.protected java.lang.StringgetColumnTypeDDL(Column column)Gets the column type DDL.protected java.lang.StringgetColumnTypeDDL(Column column, java.lang.String extra)Gets the column type DDL.protected java.lang.StringgetDefaultValue(Column column)Gets the default value.Dialect.KeyworldgetKeywords()get converted keywords.java.lang.Object[]getPaginationSqlParameter(java.lang.Object[] params, int start, int limit)返回分页参数的数组java.util.Map<java.lang.String,java.lang.Object>getPaginationSqlParameter(java.util.Map<java.lang.String,java.lang.Object> params, int start, int limit)返回分页参数的MAPprotected java.lang.StringgetPrimaryKeyDDL(Table table)Gets the primary key DDL.protected java.lang.StringgetTableColumnsDDL(Table table)Gets the table columns DDL.protected java.lang.StringgetTableComment(Table table)Gets the table comment.protected booleanisForUpdate(java.lang.String sql)判断传入sql是否带有使用for update语法booleanisKeywordsUppercase()返回keywordsUppercase.booleanisTableAndColumnNameUppercase()返回tableAndColumnNameUppercase.voidsetKeywordsUppercase(boolean keywordsUppercase)设置keywordsUppercase.voidsetTableAndColumnNameUppercase(boolean tableAndColumnNameUppercase)设置tableAndColumnNameUppercase.java.lang.StringvalueToSql(java.lang.Object value, int sqlType)转换为SQL语句中使用的字符串从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.featherfly.common.db.dialect.Dialect
buildAlterTableAddColumnDDL, buildAlterTableDDL, buildAlterTableDDL, buildAlterTableDropColumnDDL, buildAlterTableDropColumnDDL, buildAlterTableModifyColumnDDL, buildColumnSql, buildColumnSql, buildColumnSql, buildColumnSql, buildColumnSql, buildColumnSql, buildColumnSql, buildCreateDataBaseDDL, buildCreateIndexDDL, buildCreateIndexDDL, buildCreateIndexDDL, buildCreateIndexDDL, buildCreateSchemaDDL, buildDropDataBaseDDL, buildDropDataBaseDDL, buildDropDDL, buildDropIndexDDL, buildDropIndexDDL, buildDropIndexDDL, buildDropIndexDDL, buildDropSchemaDDL, buildDropSchemaDDL, buildDropTableDDL, buildDropTableDDL, buildDropTableDDL, buildDropTableDDL, buildDropTableDDL, buildDropViewDDL, buildDropViewDDL, buildDropViewDDL, buildInsertBatchSql, buildTableSql, buildTableSql, buildTableSql, convertTableOrColumnName, getColumnTypeName, getDefaultSchema, getDefaultSize, getFunction, getInitSqlFooter, getInitSqlHeader, getKeyword, getKeyword, getKeyword, getPaginationSql, getParamNamedPaginationSql, getParamNamedPaginationSql, getPrimaryKeyIndexName, getWrapSign, isAutoGenerateKeyBatch, isInsertBatch, wrapName
-
字段详细资料
-
logger
protected org.slf4j.Logger loggerThe logger. -
UPDATE_STRING
protected static final java.lang.String UPDATE_STRINGfor update的后置.- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
AbstractDialect
public AbstractDialect()Instantiates a new abstract dialect.
-
-
方法详细资料
-
isKeywordsUppercase
public boolean isKeywordsUppercase()返回keywordsUppercase.- 指定者:
isKeywordsUppercase在接口中Dialect- 返回:
- keywordsUppercase
-
setKeywordsUppercase
public void setKeywordsUppercase(boolean keywordsUppercase)设置keywordsUppercase.- 参数:
keywordsUppercase- keywordsUppercase
-
isTableAndColumnNameUppercase
public boolean isTableAndColumnNameUppercase()返回tableAndColumnNameUppercase.- 指定者:
isTableAndColumnNameUppercase在接口中Dialect- 返回:
- tableAndColumnNameUppercase
-
setTableAndColumnNameUppercase
public void setTableAndColumnNameUppercase(boolean tableAndColumnNameUppercase)设置tableAndColumnNameUppercase.- 参数:
tableAndColumnNameUppercase- tableAndColumnNameUppercase
-
buildAlterTableDDL
public java.lang.String buildAlterTableDDL(java.lang.String schema, java.lang.String tableName, Column[] addColumns, Column[] modifyColumns, Column[] dropColumns)Builds the alter table DDL.- 指定者:
buildAlterTableDDL在接口中Dialect- 参数:
schema- the database nametableName- the table nameaddColumns- the add columnsmodifyColumns- the modify columnsdropColumns- the drop columns- 返回:
- the string
-
buildAlterTableAddColumnDDL
public java.lang.String buildAlterTableAddColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table add column DDL.- 指定者:
buildAlterTableAddColumnDDL在接口中Dialect- 参数:
schema- the database nametableName- the table namecolumns- the columns- 返回:
- the string
-
buildAddColumnDDL
Builds the add column DDL.- 参数:
columns- the columns- 返回:
- the string
-
buildAlterTableModifyColumnDDL
public java.lang.String buildAlterTableModifyColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table modify column DDL.- 指定者:
buildAlterTableModifyColumnDDL在接口中Dialect- 参数:
schema- the database nametableName- the table namecolumns- the columns- 返回:
- the string
-
buildModifyColumnDDL
Builds the modify column DDL.- 参数:
columns- the columns- 返回:
- the string
-
buildAlterTableDropColumnDDL
public java.lang.String buildAlterTableDropColumnDDL(java.lang.String schema, java.lang.String tableName, Column... columns)Builds the alter table drop column DDL.- 指定者:
buildAlterTableDropColumnDDL在接口中Dialect- 参数:
schema- the database nametableName- the table namecolumns- the columns- 返回:
- the string
-
buildAlterTableDropColumnDDL
public java.lang.String buildAlterTableDropColumnDDL(java.lang.String schema, java.lang.String tableName, java.lang.String... columnNames)Builds the alter table drop column DDL.- 指定者:
buildAlterTableDropColumnDDL在接口中Dialect- 参数:
schema- the database nametableName- the table namecolumnNames- the column names- 返回:
- the string
-
buildDropColumnDDL
Builds the drop column DDL.- 参数:
columns- the columns- 返回:
- the string
-
buildDropColumnDDL
protected java.lang.String buildDropColumnDDL(java.lang.String... columnNames)Builds the drop column DDL.- 参数:
columnNames- the column names- 返回:
- the string
-
buildCreateTableDDL
Builds the create table sql.- 指定者:
buildCreateTableDDL在接口中Dialect- 参数:
table- the table- 返回:
- the string
-
getTableComment
Gets the table comment.- 参数:
table- the table- 返回:
- the table comment
-
getTableColumnsDDL
Gets the table columns DDL.- 参数:
table- the table- 返回:
- the table columns DDL
-
getColumnDDL
Gets the column DDL.- 参数:
column- the column- 返回:
- the column DDL
-
getPrimaryKeyDDL
Gets the primary key DDL.- 参数:
table- the table- 返回:
- the primary key DDL
-
getDefaultValue
Gets the default value.- 参数:
column- the column- 返回:
- the default value
-
getAutoIncrement
Gets the identity.- 参数:
column- the column- 返回:
- the identity
-
getColumnComment
Gets the column comment.- 参数:
column- the column- 返回:
- the column comment
-
getColumnNotNull
Gets the column not null.- 参数:
column- the column- 返回:
- the column not null
-
getColumnTypeDDL
Gets the column type DDL.- 参数:
column- the column- 返回:
- the column type DDL
-
getColumnTypeDDL
Gets the column type DDL.- 参数:
column- the columnextra- the extra- 返回:
- the column type DDL
-
getKeywords
get converted keywords.- 指定者:
getKeywords在接口中Dialect- 返回:
- sql key words
-
getPaginationSqlParameter
public java.lang.Object[] getPaginationSqlParameter(java.lang.Object[] params, int start, int limit)返回分页参数的数组
.- 指定者:
getPaginationSqlParameter在接口中Dialect- 参数:
params- 参数数组start- 起始数limit- 数量- 返回:
- 分页参数的数组
-
getPaginationSqlParameter
public java.util.Map<java.lang.String,java.lang.Object> getPaginationSqlParameter(java.util.Map<java.lang.String,java.lang.Object> params, int start, int limit)返回分页参数的MAP
.- 指定者:
getPaginationSqlParameter在接口中Dialect- 参数:
params- 参数MAPstart- 起始数limit- 数量- 返回:
- 分页参数的MAP
-
isForUpdate
protected boolean isForUpdate(java.lang.String sql)判断传入sql是否带有使用for update语法
.- 参数:
sql- sql- 返回:
- sql是否带有使用for update语法
-
valueToSql
public java.lang.String valueToSql(java.lang.Object value, int sqlType)转换为SQL语句中使用的字符串
.- 指定者:
valueToSql在接口中Dialect- 参数:
value- 值sqlType- sql类型- 返回:
- the string
-
convertValueToSql
protected abstract java.lang.String convertValueToSql(java.lang.Object value, int sqlType)转换值为字符串
.- 参数:
value- valuesqlType- sqlType- 返回:
- 字符串
-