org.apache.ddlutils.platform.firebird
Class FirebirdBuilder

java.lang.Object
  extended byorg.apache.ddlutils.platform.SqlBuilder
      extended byorg.apache.ddlutils.platform.firebird.FirebirdBuilder

public class FirebirdBuilder
extends SqlBuilder

The SQL Builder for the FireBird database.

Version:
$Revision: 231306 $
Author:
Martin van den Bemt

Field Summary
static String TERM_COMMAND
          Denotes the string used via SET TERM for delimiting commands that need to be executed in one go.
 
Fields inherited from class org.apache.ddlutils.platform.SqlBuilder
_log, SIZE_PLACEHOLDER
 
Constructor Summary
FirebirdBuilder(PlatformInfo info)
          Creates a new builder instance.
 
Method Summary
 void createTable(Database database, Table table, Map parameters)
          Outputs the DDL to create the table along with any non-external constraints as well as with external primary keys and indices (but not foreign keys).
 void dropTable(Table table)
          Outputs the DDL to drop the table.
protected  String getNativeDefaultValue(Column column)
          Returns the native default value for the column.
 String getSelectLastInsertId(Table table)
          Generates the SQL for querying the id that was created in the last insertion operation. This is obviously only useful for pk fields that are auto-incrementing. A database that does not support this, will return null.
protected  void writeColumnAutoIncrementStmt(Table table, Column column)
          Prints that the column is an auto increment column.
 
Methods inherited from class org.apache.ddlutils.platform.SqlBuilder
addEscapedCharSequence, alterDatabase, alterDatabase, alterDatabase, alterTable, columnsDiffer, createExternalForeignKeys, createExternalForeignKeys, createTable, createTables, createTables, createTables, dropExternalForeignKeys, dropTables, escapeStringValue, getColumnName, getConstraintName, getDefaultValueHelper, getDeleteSql, getDelimitedIdentifier, getForeignKeyName, getIndent, getIndexName, getInsertSql, getNativeType, getPlatformInfo, getSqlType, getTableName, getUpdateSql, getValueAsString, getValueLocale, getWriter, print, printComment, printEndOfStatement, printIdentifier, printIndent, println, println, printlnIdentifier, printStartOfEmbeddedStatement, setIndent, setValueLocale, setWriter, shortenName, shouldGeneratePrimaryKeys, writeColumn, writeColumnAlterStmt, writeColumnDefaultValue, writeColumnDropStmt, writeColumnNotNullableStmt, writeColumnNullableStmt, writeColumns, writeEmbeddedForeignKeysStmt, writeEmbeddedIndexCreateStmt, writeEmbeddedIndicesStmt, writeEmbeddedPrimaryKeysStmt, writeExternalForeignKeyCreateStmt, writeExternalForeignKeyDropStmt, writeExternalIndexCreateStmt, writeExternalIndexDropStmt, writeExternalIndicesCreateStmt, writeExternalPrimaryKeysCreateStmt, writeForeignReferences, writeLocalReferences, writePrimaryKeyStmt, writeTableAlterStmt, writeTableComment, writeTableCreationStmtEnding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TERM_COMMAND

public static final String TERM_COMMAND
Denotes the string used via SET TERM for delimiting commands that need to be executed in one go.

See Also:
Constant Field Values
Constructor Detail

FirebirdBuilder

public FirebirdBuilder(PlatformInfo info)
Creates a new builder instance.

Parameters:
info - The platform info
Method Detail

createTable

public void createTable(Database database,
                        Table table,
                        Map parameters)
                 throws IOException
Outputs the DDL to create the table along with any non-external constraints as well as with external primary keys and indices (but not foreign keys).

Overrides:
createTable in class SqlBuilder
Parameters:
database - The database model
table - The table
parameters - Additional platform-specific parameters for the table creation
Throws:
IOException

dropTable

public void dropTable(Table table)
               throws IOException
Outputs the DDL to drop the table.

Overrides:
dropTable in class SqlBuilder
Parameters:
table - The table to drop
Throws:
IOException

writeColumnAutoIncrementStmt

protected void writeColumnAutoIncrementStmt(Table table,
                                            Column column)
                                     throws IOException
Prints that the column is an auto increment column.

Overrides:
writeColumnAutoIncrementStmt in class SqlBuilder
Parameters:
table - The table
column - The column
Throws:
IOException

getSelectLastInsertId

public String getSelectLastInsertId(Table table)
Generates the SQL for querying the id that was created in the last insertion operation. This is obviously only useful for pk fields that are auto-incrementing. A database that does not support this, will return null.

Overrides:
getSelectLastInsertId in class SqlBuilder
Parameters:
table - The table
Returns:
The sql, or null if the database does not support this

getNativeDefaultValue

protected String getNativeDefaultValue(Column column)
Returns the native default value for the column.

Overrides:
getNativeDefaultValue in class SqlBuilder
Parameters:
column - The column
Returns:
The native default value


Copyright © 2005 Apache Software Foundation. All Rights Reserved.