org.codehaus.modello.generator.database.sql
Class OracleBuilder

java.lang.Object
  extended byorg.codehaus.modello.generator.database.sql.SqlBuilder
      extended byorg.codehaus.modello.generator.database.sql.OracleBuilder

public class OracleBuilder
extends SqlBuilder

An SQL Builder for Oracle

Version:
$Revision: 149 $
Author:
James Strachan

Field Summary
 
Fields inherited from class org.codehaus.modello.generator.database.sql.SqlBuilder
 
Constructor Summary
OracleBuilder()
           
 
Method Summary
protected  void createSequence(Table table, Column column)
          Creates a sequence so that values can be auto incremented
protected  void createSequenceTrigger(Table table, Column column)
          Creates a trigger to auto-increment values
 void createTable(Table table)
          Outputs the DDL to create the table along with any constraints
 void dropTable(Table table)
          Outputs the DDL to drop the table
protected  java.lang.String getSqlType(Column column)
           
protected  void printAutoIncrementColumn(Table table, Column column)
          Outputs the fact that this column is an auto increment column.
protected  void printComment(java.lang.String text)
          Prints an SQL comment to the current stream
 
Methods inherited from class org.codehaus.modello.generator.database.sql.SqlBuilder
alterColumn, columnsDiffer, createColumn, createDatabase, createDatabase, dropColumn, dropDatabase, dropIndex, getIndent, getNativeType, getWriter, isForeignKeyConstraintsNamed, isForeignKeysEmbedded, isIndexesEmbedded, isPrimaryKeyEmbedded, print, printEndOfStatement, printIndent, println, println, printNotNullable, printNullable, setAlterTableForDrop, setForeignKeyConstraintsNamed, setForeignKeysEmbedded, setIndent, setIndexesEmbedded, setPrimaryKeyEmbedded, setWriter, shouldGeneratePrimaryKeys, tableComment, useAlterTableForDrop, writeAlterHeader, writeColumnTypes, writeEmbeddedIndexes, writeForeignKeyAlterTable, writeForeignKeys, writeForeignKeysAlterTable, writeForeignReferences, writeIndex, writeIndexes, writeLocalReferences, writePrimaryKeys, writePrimaryKeysAlterTable, writePrimaryKeyStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleBuilder

public OracleBuilder()
Method Detail

dropTable

public void dropTable(Table table)
               throws java.io.IOException
Description copied from class: SqlBuilder
Outputs the DDL to drop the table

Overrides:
dropTable in class SqlBuilder
Throws:
java.io.IOException

printComment

protected void printComment(java.lang.String text)
                     throws java.io.IOException
Description copied from class: SqlBuilder
Prints an SQL comment to the current stream

Overrides:
printComment in class SqlBuilder
Throws:
java.io.IOException

createTable

public void createTable(Table table)
                 throws java.io.IOException
Description copied from class: SqlBuilder
Outputs the DDL to create the table along with any constraints

Overrides:
createTable in class SqlBuilder
Throws:
java.io.IOException

printAutoIncrementColumn

protected void printAutoIncrementColumn(Table table,
                                        Column column)
                                 throws java.io.IOException
Description copied from class: SqlBuilder
Outputs the fact that this column is an auto increment column.

Overrides:
printAutoIncrementColumn in class SqlBuilder
Throws:
java.io.IOException

createSequence

protected void createSequence(Table table,
                              Column column)
                       throws java.io.IOException
Creates a sequence so that values can be auto incremented

Throws:
java.io.IOException

createSequenceTrigger

protected void createSequenceTrigger(Table table,
                                     Column column)
                              throws java.io.IOException
Creates a trigger to auto-increment values

Throws:
java.io.IOException

getSqlType

protected java.lang.String getSqlType(Column column)
Overrides:
getSqlType in class SqlBuilder
Returns:
the full SQL type string, including size where appropriate. Where necessary, translate for Oracle specific DDL requirements.