Class BaseDialect

java.lang.Object
org.huiche.dialect.BaseDialect
All Implemented Interfaces:
Dialect
Direct Known Subclasses:
DB2Dialect, DMDialect, H2Dialect, HSQLDialect, MySQLDialect, OracleDialect, PostgreSQLDialect, SQLiteDialect, SQLServerDialect

public abstract class BaseDialect extends Object implements Dialect
默认方言实现
Author:
Maning
  • Field Details

    • keywords

      protected final Set<String> keywords
      数据库关键字
    • quoteString

      protected final String quoteString
      标识符转义字符串
  • Constructor Details

    • BaseDialect

      public BaseDialect()
      默认构造
    • BaseDialect

      public BaseDialect(String quoteString)
      自定义转义标识符构造
      Parameters:
      quoteString - 标识符转义字符串
    • BaseDialect

      public BaseDialect(String quoteString, Set<String> keywords)
      默认构造
      Parameters:
      quoteString - 标识符转义字符串
      keywords - 关键字(SQL2003内置除外)
  • Method Details

    • quote

      public String quote(String identifier)
      Description copied from interface: Dialect
      标识符转义
      Specified by:
      quote in interface Dialect
      Parameters:
      identifier - 标识符
      Returns:
      转义后标识符
    • translate

      public Translation translate(Statement statement)
      Description copied from interface: Dialect
      将语句翻译为sql
      Specified by:
      translate in interface Dialect
      Parameters:
      statement - 语句,不能为null
      Returns:
      翻译结果,不允许返回null
    • translate

      public Translation translate(Segment segment)
      Description copied from interface: Dialect
      将SQL片段翻译为sql
      Specified by:
      translate in interface Dialect
      Parameters:
      segment - SQL片段,不能为null
      Returns:
      翻译结果,不允许返回null
    • translateCustom

      public Translation translateCustom(Segment segment)
      Description copied from interface: Dialect
      转译自定义SQL,会在转译最后执行
      Specified by:
      translateCustom in interface Dialect
      Parameters:
      segment - SQL片段,不能为null
      Returns:
      翻译结果,不允许返回null
    • translatePaging

      public Translation translatePaging(Integer limit, Integer offset)
      Description copied from interface: Dialect
      转译分页
      Specified by:
      translatePaging in interface Dialect
      Parameters:
      limit - 限制条数
      offset - 跳过条数
      Returns:
      分页语法