wt.tools.generation.sql
Class OracleStandardSQLGenerator

java.lang.Object
  extended bywt.tools.generation.sql.SQLGenerator
      extended bywt.tools.generation.sql.OracleSQLGenerator
          extended bywt.tools.generation.sql.OracleStandardSQLGenerator

public class OracleStandardSQLGenerator
extends OracleSQLGenerator

Construct a block of sql code for Standard Oracle to create a table, Index and computed columns. Standard Oracle 8i,9i does not support Function Based Indexes, So most of the code in this class is to work around function based Indexes with computed columns in the tables and having triggers on the table to populate the computed column with the prespecified function and to create index on the computed column to simulate function based indexes.


Field Summary
 
Fields inherited from class wt.tools.generation.sql.OracleSQLGenerator
properties
 
Fields inherited from class wt.tools.generation.sql.SQLGenerator
COMMA_DELIMITER, DB_DELIMITER
 
Constructor Summary
OracleStandardSQLGenerator()
           
 
Method Summary
private  void changeExpression(ColumnDescriptor[] allTableColumns, String functionDefinition, StringBuffer newFunction, StringBuffer columnList)
           
 String createTriggerItems(String a_className, DatabaseInfo a_dbInfo)
           
 String dropTriggerItems(String a_className, DatabaseInfo a_dbInfo)
           
 ColumnDescriptor[] getComputedColumns(BaseTableInfo a_tableInfo)
           
 String[] getIndexColumns(String[] a_indexColumns, boolean a_isUnique, int a_indexOffset)
           
 ColumnDescriptor[] getTableColumns(BaseTableInfo a_tableInfo)
           
 HashSet getTriggerNameList(BaseTableInfo tableInfo)
           
 HashSet getUpdateColumnList(BaseTableInfo tableInfo)
           
private  String replaceAll(String original, String insert, String remove)
           
 
Methods inherited from class wt.tools.generation.sql.OracleSQLGenerator
createArray, createColumnIndex, createFKConstraints, createIndexOption, createIndicies, createSequence, createStruct, createTable, createTriggerConstraints_removeLink, createTriggerConstraints_removeRole, dropArray, dropColumnIndex, dropFKConstraints, dropIndex, dropIndicies, dropSequence, dropStruct, dropTable, getCommitDelimiter, getIndexColumns, getMaxIndexNameLength, getSQLTypeAsString, getSQLTypeString, getUniqueNames, isReservedWord, isSQLTypeBlob, isSqlTypeLob, preCreateView
 
Methods inherited from class wt.tools.generation.sql.SQLGenerator
createAllClassesTriggerConstraintItems, createAlterTableAddColumns, createAlterTableDropColumns, createFKConstraintItems, createFKConstraintItems, createFKConstraintItems, createIndex, createIndexItems, createLinkSpecificTriggerConstraintItems, createLinkTriggerConstraintItems, createRoleFKConstraintItems, createRoleTriggerConstraintItems, createTableItems, createTriggerConstraintItems, createView, dropIndexItems, dropView, getAdjustedName, getComputedIndexColumns, getDescendentTables, getIndexName, getProcessedLinkInfos, isComputedColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleStandardSQLGenerator

public OracleStandardSQLGenerator()
Method Detail

getUpdateColumnList

public HashSet getUpdateColumnList(BaseTableInfo tableInfo)
                            throws WTException
Overrides:
getUpdateColumnList in class SQLGenerator
Throws:
WTException

getTriggerNameList

public HashSet getTriggerNameList(BaseTableInfo tableInfo)
                           throws WTException
Overrides:
getTriggerNameList in class SQLGenerator
Throws:
WTException

createTriggerItems

public String createTriggerItems(String a_className,
                                 DatabaseInfo a_dbInfo)
                          throws WTException
Overrides:
createTriggerItems in class OracleSQLGenerator
Throws:
WTException

changeExpression

private void changeExpression(ColumnDescriptor[] allTableColumns,
                              String functionDefinition,
                              StringBuffer newFunction,
                              StringBuffer columnList)

dropTriggerItems

public String dropTriggerItems(String a_className,
                               DatabaseInfo a_dbInfo)
                        throws WTException
Overrides:
dropTriggerItems in class SQLGenerator
Throws:
WTException

getComputedColumns

public ColumnDescriptor[] getComputedColumns(BaseTableInfo a_tableInfo)
                                      throws WTException
Overrides:
getComputedColumns in class SQLGenerator
Throws:
WTException

getIndexColumns

public String[] getIndexColumns(String[] a_indexColumns,
                                boolean a_isUnique,
                                int a_indexOffset)

getTableColumns

public ColumnDescriptor[] getTableColumns(BaseTableInfo a_tableInfo)
                                   throws WTException
Overrides:
getTableColumns in class SQLGenerator
Throws:
WTException

replaceAll

private String replaceAll(String original,
                          String insert,
                          String remove)