Class Dialect

java.lang.Object
com.exedio.dsmf.Dialect

public abstract class Dialect extends Object
  • Field Details

  • Constructor Details

    • Dialect

      protected Dialect(String schema)
  • Method Details

    • getSchema

      protected final String getSchema()
    • quoteName

      public String quoteName(String name)
      Quotes a database name. This prevents the name from being interpreted as a SQL keyword. This is usually done by enclosing the name with some (database specific) quotation characters. The default implementation uses double quotes as specified by ANSI SQL.
    • supportsCheckConstraints

      public boolean supportsCheckConstraints()
    • supportsSemicolon

      public boolean supportsSemicolon()
    • adjustExistingCheckConstraintCondition

      protected String adjustExistingCheckConstraintCondition(String s)
    • getColumnType

      protected abstract String getColumnType(int dataType, ResultSet resultSet) throws SQLException
      Throws:
      SQLException
    • verify

      protected abstract void verify(Schema schema)
    • verifyTablesByMetaData

      protected static final void verifyTablesByMetaData(Schema schema)
    • verifyColumnsByMetaData

      protected final void verifyColumnsByMetaData(Schema schema, String tableSchema)
      Parameters:
      tableSchema - null means any schema is allowed
    • verifyForeignKeyConstraints

      protected static final void verifyForeignKeyConstraints(String sql, Schema schema)
    • verifyUniqueConstraints

      protected static final void verifyUniqueConstraints(String sql, Schema schema)
    • verifySequences

      protected static final void verifySequences(String sql, Schema schema)
    • notifyExistentTable

      protected static final void notifyExistentTable(Schema schema, String tableName)
    • notifyExistentColumn

      protected static final Column notifyExistentColumn(Table table, String columnName, String existingType)
    • notifyExistentCheck

      protected static final void notifyExistentCheck(Table table, String constraintName, String condition)
    • notifyExistentPrimaryKey

      protected static final void notifyExistentPrimaryKey(Table table, String constraintName)
    • notifyExistentUnique

      protected static final void notifyExistentUnique(Table table, String constraintName, String condition)
    • notifyExists

      protected static final void notifyExists(Sequence sequence, Sequence.Type existingType)
    • getBooleanStrict

      protected static final boolean getBooleanStrict(ResultSet resultSet, int columnIndex, String trueValue, String falseValue) throws SQLException
      Throws:
      SQLException
    • getTableStrict

      protected static final Table getTableStrict(Schema schema, ResultSet resultSet, int columnIndex) throws SQLException
      Throws:
      SQLException
    • querySQL

      protected final void querySQL(Schema schema, String statement, Dialect.ResultSetHandler resultSetHandler)
    • getCatalog

      protected static final String getCatalog(Schema schema)
    • appendTableCreateStatement

      protected void appendTableCreateStatement(StringBuilder bf)
      Parameters:
      bf - used in subclasses
    • needsTargetColumnName

      protected boolean needsTargetColumnName()
    • appendForeignKeyCreateStatement

      protected void appendForeignKeyCreateStatement(StringBuilder bf)
      Parameters:
      bf - used in subclasses
    • renameTable

      public String renameTable(String tableName, String newTableName)
    • renameColumn

      public abstract String renameColumn(String tableName, String oldColumnName, String newColumnName, String columnType)
    • createColumn

      public abstract String createColumn(String tableName, String columnName, String columnType)
    • modifyColumn

      public abstract String modifyColumn(String tableName, String columnName, String newColumnType)
    • dropPrimaryKeyConstraint

      protected void dropPrimaryKeyConstraint(StringBuilder bf, String tableName, String constraintName)
    • dropForeignKeyConstraint

      protected void dropForeignKeyConstraint(StringBuilder bf, String tableName, String constraintName)
    • dropUniqueConstraint

      protected void dropUniqueConstraint(StringBuilder bf, String tableName, String constraintName)
    • createSequence

      protected abstract void createSequence(StringBuilder bf, String sequenceName, Sequence.Type type, long start)
    • dropSequence

      protected void dropSequence(StringBuilder bf, String sequenceName)
    • deleteSchema

      @Deprecated public final void deleteSchema(Schema schema)
      Deprecated.
      The default implementation just drops and re-creates the schema. Subclasses are encouraged to provide a more efficient implementation.