|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Dialect
SQL Dialects provide DBMS specific helpers to allow unified SQL commands.
Method Summary | |
---|---|
java.lang.String |
constructJDBCURL(java.lang.String hostname,
java.lang.Integer port,
java.lang.String databaseName,
java.util.Properties properties)
Constructs a JDBC URL for the dialect; all parameters may be null, default values are used then. |
java.lang.String |
createColumnSpec(ColumnInfo columnInfo)
Computes a string to feed a CREATE TABLE or ALTER TABLE ADD COLUMN statement, or returns null if the type is unsupported by the underlying DBMS or by the Dialect implementation. |
java.lang.String |
defaultDriverName()
|
java.lang.String |
getID()
|
java.lang.String |
normalizeDefaultValue(int type,
java.lang.String s)
Normalize a default value returned by DatabaseMetaData.getColumns(String, String, String, String)
in the column COLUMN_DEF . |
void |
pushAddColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo ci)
Push the add column command to a command queue. |
void |
pushAddForeignKey(SqlCommandQueue queue,
TableInfo ti,
ForeignKeyInfo fki)
Push the add foreign key command to a command queue. |
void |
pushAddIndex(SqlCommandQueue queue,
TableInfo ti,
IndexInfo indexInfo)
Push the add index command to a command queue. |
void |
pushChangeColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo oldColumnInfo,
ColumnInfo newColumnInfo)
Rename and change the datatype of a database column. |
void |
pushCreateTable(SqlCommandQueue queue,
TableInfo ti)
Push the create table command to a command queue. |
void |
pushDropColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo ci,
boolean force)
Push the drop column command to a command queue. |
void |
pushDropForeignKey(SqlCommandQueue queue,
TableInfo ti,
ForeignKeyInfo fki)
Push the drop foreign key command to a command queue. |
void |
pushDropIndex(SqlCommandQueue queue,
TableInfo ti,
IndexInfo indexInfo)
Push the drop index command to a command queue. |
void |
pushDropTable(SqlCommandQueue queue,
TableInfo ti,
boolean force)
Push the drop table command to a command queue. |
void |
pushModifyColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo oldColumnInfo,
ColumnInfo newColumnInfo)
Modify the datatype of a database column. |
void |
quoteString(java.lang.StringBuffer sb,
java.lang.String s)
Quote the given string to the string buffer. |
Method Detail |
---|
java.lang.String getID()
void quoteString(java.lang.StringBuffer sb, java.lang.String s)
sb
- The buffer to write to.s
- the String to quote.java.lang.String normalizeDefaultValue(int type, java.lang.String s)
DatabaseMetaData.getColumns(String, String, String, String)
in the column COLUMN_DEF
.
Some database engines return the default value in a quoted manner, so
we must perform unquoting here.
type
- The java.sql.Types constant of the column type.s
- The string to normalize.
java.lang.String createColumnSpec(ColumnInfo columnInfo)
columnInfo
-
void pushCreateTable(SqlCommandQueue queue, TableInfo ti) throws java.sql.SQLException
queue
- The queue to push to.ti
- The table info for which to push the create table command.
java.sql.SQLException
void pushDropTable(SqlCommandQueue queue, TableInfo ti, boolean force) throws java.sql.SQLException
queue
- The queue to push to.ti
- The table info for which to push the drop table command.force
- If set to true, the data is not backed up before dropping the
table. Consequently, rollback is not supported, if
force
is set to true.
java.sql.SQLException
void pushAddForeignKey(SqlCommandQueue queue, TableInfo ti, ForeignKeyInfo fki) throws java.sql.SQLException
queue
- The queue to push to.fki
- The foreign key description.ti
- The table info for which to push the add foreign key command.
java.sql.SQLException
void pushDropForeignKey(SqlCommandQueue queue, TableInfo ti, ForeignKeyInfo fki) throws java.sql.SQLException
queue
- The queue to push to.fki
- The foreign key description.ti
- The table info for which to push the drop foreign key command.
java.sql.SQLException
void pushAddIndex(SqlCommandQueue queue, TableInfo ti, IndexInfo indexInfo) throws java.sql.SQLException
queue
- The queue to push to.indexInfo
- The index description.ti
- The table info for which to push the add index command.
java.sql.SQLException
void pushDropIndex(SqlCommandQueue queue, TableInfo ti, IndexInfo indexInfo) throws java.sql.SQLException
queue
- The queue to push to.indexInfo
- The index description.ti
- The table info for which to push the drop index command.
java.sql.SQLException
void pushAddColumn(SqlCommandQueue queue, TableInfo ti, ColumnInfo ci) throws java.sql.SQLException
queue
- The queue to push to.ci
- The column description.ti
- The table info for which to push the add column command.
java.sql.SQLException
void pushDropColumn(SqlCommandQueue queue, TableInfo ti, ColumnInfo ci, boolean force) throws java.sql.SQLException
queue
- The queue to push to.ti
- The table info for which to push the add column command.ci
- The column description.force
- f set to true, the data is not backed up before dropping the
column. Consequently, rollback is not supported, if
force
is set to true.
java.sql.SQLException
void pushModifyColumn(SqlCommandQueue queue, TableInfo ti, ColumnInfo oldColumnInfo, ColumnInfo newColumnInfo) throws java.sql.SQLException
queue
- The queue to push to.ti
- The description of the database table.oldColumnInfo
- The column info as represented by the current schema.newColumnInfo
- The column information carrying the column name and the new datatype.
java.sql.SQLException
void pushChangeColumn(SqlCommandQueue queue, TableInfo ti, ColumnInfo oldColumnInfo, ColumnInfo newColumnInfo) throws java.sql.SQLException
queue
- The queue to push to.ti
- The description of the database table.oldColumnInfo
- The original column info of the column to be changed.newColumnInfo
- The destination column info carrying the new column name and the new datatype.
java.sql.SQLException
java.lang.String defaultDriverName()
java.lang.String constructJDBCURL(java.lang.String hostname, java.lang.Integer port, java.lang.String databaseName, java.util.Properties properties)
hostname
- Name of the host to connect to, use null get the default value "localhost" for Client/Server resp. non-net URLs for integrated engines.port
- IP port to connect to, use null to use the dialect specific default port for Client/Server resp. non-net URLs for integrated engines.databaseName
- name of the database to connect to, use null to connect w/o a certain databaseproperties
- Properties to add to the URL, usually for tweaking the JDBC driver, may be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |