Interface ISqlDialect<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>

Type Parameters:
SELECT - the generic type
INSERT - the generic type
UPDATE - the generic type
DELETE - the generic type
CREATE - the generic type
ALTER - the generic type
DROP - the generic type
NEXT - the generic type
LAST - the generic type
All Superinterfaces:
ISqlFactory<SELECT,INSERT,UPDATE,DELETE,CREATE,ALTER,DROP,NEXT,LAST>, ISqlKeywords
All Known Implementing Classes:
DefaultSqlDialect

public interface ISqlDialect<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder> extends ISqlFactory<SELECT,INSERT,UPDATE,DELETE,CREATE,ALTER,DROP,NEXT,LAST>, ISqlKeywords
The SQL Dialect interface.
  • Field Details

    • FUNCTIONS

      static final Set FUNCTIONS
      The Constant FUNCTIONS.
  • Method Details

    • getDataTypeName

      String getDataTypeName(DataType dataType)
      Default implementation returns the direct toString() conversion. It may get overridden for specific database dialects
      Parameters:
      dataType - the data type
      Returns:
      the data type name
    • getPrimaryKeyArgument

      String getPrimaryKeyArgument()
      PRIMARY KEY argument for a column for the create table script Default is "PRIMARY KEY".
      Returns:
      the primary key argument
    • getIdentityArgument

      String getIdentityArgument()
      Identity argument for a column for the create table script Default is "IDENTITY".
      Returns:
      the primary key argument
    • getNotNullArgument

      String getNotNullArgument()
      NOT NULL argument for a column for the create table script Default is "NOT NULL".
      Returns:
      the not null argument
    • getUniqueArgument

      String getUniqueArgument()
      UNIQUE argument for a column for the create table script Default is "UNIQUE".
      Returns:
      the unique argument
    • existsTable

      boolean existsTable(Connection connection, String table) throws SQLException
      Check existence of a table.
      Specified by:
      existsTable in interface ISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>
      Parameters:
      connection - the current connection
      table - the table name
      Returns:
      true if the table exists and false otherwise
      Throws:
      SQLException - the SQL exception
    • exists

      boolean exists(Connection connection, String name, int type) throws SQLException
      Check existence of an artifacts.
      Specified by:
      exists in interface ISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>
      Parameters:
      connection - the current connection
      name - the artifact name
      type - the artifact type
      Returns:
      true if the table exists and false otherwise
      Throws:
      SQLException - the SQL exception
    • existsSchema

      boolean existsSchema(Connection connection, String schema) throws SQLException
      Check existence of a schema.
      Specified by:
      existsSchema in interface ISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>
      Parameters:
      connection - the current connection
      schema - the schema name
      Returns:
      true if the table exists and false otherwise
      Throws:
      SQLException - the SQL exception
    • isSchemaFilterSupported

      boolean isSchemaFilterSupported()
      Checks if the database is capable of schema-level filtering statements (e.g. to reduce the provisioned schemas down to those that the current user is entitled to see).
      Returns:
      true if the feature is supported, false otherwise
    • getSchemaFilterScript

      String getSchemaFilterScript()
      If the database supports schema filtering SQL statements (see isSchemaFilterSupported()), this method provides the corresponding SQL statement.
      Returns:
      a filtering SQL statement
    • isCatalogForSchema

      boolean isCatalogForSchema()
      Does this database support catalogs synonymous to schemas.
      Returns:
      whether it is a catalog for schema
    • functionCurrentDate

      String functionCurrentDate()
      Gives the dialect specific name of the CURRENT_DATE function.
      Returns:
      the name of the function
    • functionCurrentTime

      String functionCurrentTime()
      Gives the dialect specific name of the CURRENT_TIME function.
      Returns:
      the name of the function
    • functionCurrentTimestamp

      String functionCurrentTimestamp()
      Gives the dialect specific name of the CURRENT_TIMESTAMP function.
      Returns:
      the name of the function
    • isSequenceSupported

      boolean isSequenceSupported()
      Checks if the database is capable to create and use Sequences.
      Returns:
      true if the feature is supported, false otherwise
    • getDatabaseName

      String getDatabaseName(Connection connection)
      Returns the database name.
      Parameters:
      connection - the active database connection
      Returns:
      the database name
    • isSynonymSupported

      boolean isSynonymSupported()
      Checks if the database is capable to create and use Synonyms.
      Returns:
      true if the feature is supported, false otherwise
    • getFunctionsNames

      Set<String> getFunctionsNames()
      Returns the function names.
      Returns:
      the list of functions names
    • getFuzzySearchIndex

      String getFuzzySearchIndex()
      Returns the creation of fuzzy search index.
      Returns:
      the string for creating the Fuzzy Search Index
    • getEscapeSymbol

      String getEscapeSymbol()
      Returns the escape symbol.
      Returns:
      the string for escape symbol
    • count

      int count(Connection connection, String table) throws SQLException
      Count.
      Parameters:
      connection - the connection
      table - the table
      Returns:
      the count
      Throws:
      SQLException - the SQL exception
    • all

      ResultSet all(Connection connection, String table) throws SQLException
      Count.
      Parameters:
      connection - the connection
      table - the table
      Returns:
      the result set
      Throws:
      SQLException - the SQL exception
    • countQuery

      String countQuery(String table)
      Count.
      Parameters:
      table - the table
      Returns:
      the count query
    • allQuery

      String allQuery(String table)
      All.
      Parameters:
      table - the table
      Returns:
      the all query
    • exportData

      void exportData(Connection connection, String table, OutputStream output) throws Exception
      Export data.
      Parameters:
      connection - the connection
      table - the table
      output - the output
      Throws:
      Exception - Signals that an I/O or SQL exception has occurred.
    • importData

      void importData(Connection connection, String table, InputStream input) throws Exception
      Import data.
      Parameters:
      connection - the connection
      table - the table
      input - the input
      Throws:
      Exception - Signals that an I/O or SQL exception has occurred.