Package com.exedio.dsmf
Class Dialect
java.lang.Object
com.exedio.dsmf.Dialect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
protected static final class
protected static final class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected void
protected void
abstract String
createColumn
(String tableName, String columnName, String columnType) protected abstract void
createSequence
(StringBuilder bf, String sequenceName, Sequence.Type type, long start) final void
deleteSchema
(Schema schema) Deprecated.protected void
dropForeignKeyConstraint
(StringBuilder bf, String tableName, String constraintName) protected void
dropPrimaryKeyConstraint
(StringBuilder bf, String tableName, String constraintName) protected void
dropSequence
(StringBuilder bf, String sequenceName) protected void
dropUniqueConstraint
(StringBuilder bf, String tableName, String constraintName) protected static final boolean
getBooleanStrict
(ResultSet resultSet, int columnIndex, String trueValue, String falseValue) protected static final String
getCatalog
(Schema schema) protected abstract String
getColumnType
(int dataType, ResultSet resultSet) protected final String
protected static final Table
getTableStrict
(Schema schema, ResultSet resultSet, int columnIndex) abstract String
modifyColumn
(String tableName, String columnName, String newColumnType) protected boolean
protected static final void
notifyExistentCheck
(Table table, String constraintName, String condition) protected static final Column
notifyExistentColumn
(Table table, String columnName, String existingType) protected static final void
notifyExistentPrimaryKey
(Table table, String constraintName) protected static final void
notifyExistentTable
(Schema schema, String tableName) protected static final void
notifyExistentUnique
(Table table, String constraintName, String condition) protected static final void
notifyExists
(Sequence sequence, Sequence.Type existingType) protected final void
querySQL
(Schema schema, String statement, Dialect.ResultSetHandler resultSetHandler) Quotes a database name.abstract String
renameColumn
(String tableName, String oldColumnName, String newColumnName, String columnType) renameTable
(String tableName, String newTableName) boolean
boolean
protected abstract void
protected final void
verifyColumnsByMetaData
(Schema schema, String tableSchema) protected static final void
verifyForeignKeyConstraints
(String sql, Schema schema) protected static final void
verifySequences
(String sql, Schema schema) protected static final void
verifyTablesByMetaData
(Schema schema) protected static final void
verifyUniqueConstraints
(String sql, Schema schema)
-
Field Details
-
NOT_NULL
- See Also:
-
-
Constructor Details
-
Dialect
-
-
Method Details
-
getSchema
-
quoteName
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
-
getColumnType
- Throws:
SQLException
-
verify
-
verifyTablesByMetaData
-
verifyColumnsByMetaData
- Parameters:
tableSchema
- null means any schema is allowed
-
verifyForeignKeyConstraints
-
verifyUniqueConstraints
-
verifySequences
-
notifyExistentTable
-
notifyExistentColumn
-
notifyExistentCheck
-
notifyExistentPrimaryKey
-
notifyExistentUnique
-
notifyExists
-
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
-
appendTableCreateStatement
- Parameters:
bf
- used in subclasses
-
needsTargetColumnName
protected boolean needsTargetColumnName() -
appendForeignKeyCreateStatement
- Parameters:
bf
- used in subclasses
-
renameTable
-
renameColumn
-
createColumn
-
modifyColumn
-
dropPrimaryKeyConstraint
-
dropForeignKeyConstraint
-
dropUniqueConstraint
-
createSequence
protected abstract void createSequence(StringBuilder bf, String sequenceName, Sequence.Type type, long start) -
dropSequence
-
deleteSchema
Deprecated.UseModel.deleteSchema()
instead.The default implementation just drops and re-creates the schema. Subclasses are encouraged to provide a more efficient implementation.
-
Model.deleteSchema()
instead.