|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clazzes.jdbc2xml.schema.impl.DerbyDialect
public class DerbyDialect
This class implements Dialect for Derby 10.x
| Field Summary | |
|---|---|
static java.lang.String |
defaultDriverName
|
| Constructor Summary | |
|---|---|
DerbyDialect()
|
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String defaultDriverName
| Constructor Detail |
|---|
public DerbyDialect()
| Method Detail |
|---|
public java.lang.String getID()
getID in interface Dialect
public void pushCreateTable(SqlCommandQueue queue,
TableInfo ti)
Dialect
pushCreateTable in interface Dialectqueue - The queue to push to.ti - The table info for which to push the create table command.
public void pushDropTable(SqlCommandQueue queue,
TableInfo ti,
boolean force)
Dialect
pushDropTable in interface Dialectqueue - 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.public java.lang.String createColumnSpec(ColumnInfo columnInfo)
Dialect
createColumnSpec in interface Dialectpublic java.lang.String defaultDriverName()
defaultDriverName in interface Dialect
public void quoteString(java.lang.StringBuffer sb,
java.lang.String s)
Dialect
quoteString in interface Dialectsb - The buffer to write to.s - the String to quote.
public java.lang.String normalizeDefaultValue(int type,
java.lang.String s)
DialectDatabaseMetaData.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.
normalizeDefaultValue in interface Dialecttype - The java.sql.Types constant of the column type.s - The string to normalize.
public void pushAddForeignKey(SqlCommandQueue queue,
TableInfo ti,
ForeignKeyInfo fki)
throws java.sql.SQLException
Dialect
pushAddForeignKey in interface Dialectqueue - The queue to push to.ti - The table info for which to push the add foreign key command.fki - The foreign key description.
java.sql.SQLException
public void pushDropForeignKey(SqlCommandQueue queue,
TableInfo ti,
ForeignKeyInfo fki)
throws java.sql.SQLException
Dialect
pushDropForeignKey in interface Dialectqueue - The queue to push to.ti - The table info for which to push the drop foreign key command.fki - The foreign key description.
java.sql.SQLException
public void pushAddIndex(SqlCommandQueue queue,
TableInfo ti,
IndexInfo indexInfo)
throws java.sql.SQLException
Dialect
pushAddIndex in interface Dialectqueue - The queue to push to.ti - The table info for which to push the add index command.indexInfo - The index description.
java.sql.SQLException
public void pushDropIndex(SqlCommandQueue queue,
TableInfo ti,
IndexInfo indexInfo)
throws java.sql.SQLException
Dialect
pushDropIndex in interface Dialectqueue - The queue to push to.ti - The table info for which to push the drop index command.indexInfo - The index description.
java.sql.SQLException
public void pushAddColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo ci)
throws java.sql.SQLException
Dialect
pushAddColumn in interface Dialectqueue - The queue to push to.ti - The table info for which to push the add column command.ci - The column description.
java.sql.SQLException
public void pushDropColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo ci,
boolean force)
throws java.sql.SQLException
Dialect
pushDropColumn in interface Dialectqueue - 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
public void pushChangeColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo oldColumnInfo,
ColumnInfo newColumnInfo)
throws java.sql.SQLException
Dialect
pushChangeColumn in interface Dialectqueue - 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
public void pushModifyColumn(SqlCommandQueue queue,
TableInfo ti,
ColumnInfo oldColumnInfo,
ColumnInfo newColumnInfo)
throws java.sql.SQLException
Dialect
pushModifyColumn in interface Dialectqueue - 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
public java.lang.String constructJDBCURL(java.lang.String hostname,
java.lang.Integer port,
java.lang.String databaseName,
java.util.Properties properties)
Dialect
constructJDBCURL in interface Dialecthostname - 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 | |||||||||