类 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

数据库方言的抽象类. 实现了一些通用内容.

  • 字段详细资料

    • logger

      protected org.slf4j.Logger logger
      The logger.
    • UPDATE_STRING

      protected static final java.lang.String UPDATE_STRING
      for 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 name
      tableName - the table name
      addColumns - the add columns
      modifyColumns - the modify columns
      dropColumns - 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 name
      tableName - the table name
      columns - the columns
      返回:
      the string
    • buildAddColumnDDL

      protected java.lang.String buildAddColumnDDL​(Column... columns)
      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 name
      tableName - the table name
      columns - the columns
      返回:
      the string
    • buildModifyColumnDDL

      protected java.lang.String buildModifyColumnDDL​(Column... columns)
      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 name
      tableName - the table name
      columns - 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 name
      tableName - the table name
      columnNames - the column names
      返回:
      the string
    • buildDropColumnDDL

      protected java.lang.String buildDropColumnDDL​(Column... columns)
      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

      public java.lang.String buildCreateTableDDL​(Table table)
      Builds the create table sql.
      指定者:
      buildCreateTableDDL 在接口中 Dialect
      参数:
      table - the table
      返回:
      the string
    • getTableComment

      protected java.lang.String getTableComment​(Table table)
      Gets the table comment.
      参数:
      table - the table
      返回:
      the table comment
    • getTableColumnsDDL

      protected java.lang.String getTableColumnsDDL​(Table table)
      Gets the table columns DDL.
      参数:
      table - the table
      返回:
      the table columns DDL
    • getColumnDDL

      protected java.lang.String getColumnDDL​(Column column)
      Gets the column DDL.
      参数:
      column - the column
      返回:
      the column DDL
    • getPrimaryKeyDDL

      protected java.lang.String getPrimaryKeyDDL​(Table table)
      Gets the primary key DDL.
      参数:
      table - the table
      返回:
      the primary key DDL
    • getDefaultValue

      protected java.lang.String getDefaultValue​(Column column)
      Gets the default value.
      参数:
      column - the column
      返回:
      the default value
    • getAutoIncrement

      protected abstract java.lang.String getAutoIncrement​(Column column)
      Gets the identity.
      参数:
      column - the column
      返回:
      the identity
    • getColumnComment

      protected java.lang.String getColumnComment​(Column column)
      Gets the column comment.
      参数:
      column - the column
      返回:
      the column comment
    • getColumnNotNull

      protected java.lang.String getColumnNotNull​(Column column)
      Gets the column not null.
      参数:
      column - the column
      返回:
      the column not null
    • getColumnTypeDDL

      protected java.lang.String getColumnTypeDDL​(Column column)
      Gets the column type DDL.
      参数:
      column - the column
      返回:
      the column type DDL
    • getColumnTypeDDL

      protected java.lang.String getColumnTypeDDL​(Column column, java.lang.String extra)
      Gets the column type DDL.
      参数:
      column - the column
      extra - the extra
      返回:
      the column type DDL
    • getKeywords

      public Dialect.Keyworld 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 - 参数MAP
      start - 起始数
      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 - value
      sqlType - sqlType
      返回:
      字符串