Oracle Fusion Middleware extensions for XML based Datamodel Framework
11g Release 1 (11.1.1.5)

E22566-01

oracle.apps.fnd.applxdf.comp
Class TableObject

java.lang.Object
  extended by oracle.apps.fnd.applxdf.comp.DBObject
      extended by oracle.apps.fnd.applxdf.comp.TableObject

public class TableObject
extends DBObject

Contains methods to create a Table, compare existing Table with the defintition in the xml file and generate DDLs statements if possible to map the differences or throw errors

Author:
Guoqiang Su <Guoqiang.Su@oracle.com>, izhang <irene.zhang@oracle.com>

Field Summary
 
Fields inherited from class oracle.apps.fnd.applxdf.comp.DBObject
indexExists, logger, mapPartition, notToEmitAlterDDLArray, objDoc, objectName, objElm, param
 
Constructor Summary
TableObject()
          Constructor.
TableObject(Parameters param, XDFLogger logger)
          Constructor with arguments.
 
Method Summary
 boolean checkGlobalTemporaryDifferent()
          Check to see whether the gloabl temprorary info from the xdf file is the same as those in the target db.
 boolean checkTargetDBObjectExists()
          Check whether the table Object exists in the target db or not.
 void doConstraints(boolean objExists, boolean changeDB)
          Process the constraints.
 void doCreateDDLConstraints(oracle.xml.parser.v2.XMLElement xElm)
          Get the create table add constraint DDLs and add to arraylist.
protected  java.util.Hashtable getAlterXMLParameters()
          Get the alter XML parameters
protected  java.lang.String getAlterXMLXSLFile()
          Get the alter XML XSL file.
protected  java.util.HashMap getClauseTypeNotToEmit()
          Get the clause type not to emit.
 java.util.ArrayList getColumnList()
          Get the column list.
 void getCommentFromColumns(java.util.HashMap colsHashMap)
          Get the comment from columns.
 java.lang.String getCommentFromTable()
          Get the comment from table.
protected  java.util.Hashtable getCreateDDLParameters()
          Get the create DDL parameters.
protected  java.lang.String getCreateDDLXSLFile()
          Get the create DDL XSL file.
protected  void getDataFromSXML(oracle.xml.parser.v2.XMLElement xmlElm)
          Get the data from the XML Element.
protected  void getDataFromTargetDB(java.sql.ResultSet rset)
          Get the data from target db.
 oracle.sql.CLOB getDiffDocument(oracle.sql.CLOB tranformCLOB)
          Compare the difference of the two table documents and generate the difference CLOB.
 java.util.HashMap getIsLogical(oracle.xml.parser.v2.XMLElement xmlElm)
          Get the ISLOGICAL value for each constraint.
 boolean getNeedRebuildIndexes()
          Get the need rebuild index flag.
 java.util.HashMap getObsoleteColNames()
          Get the obsolete column names.
 java.lang.String getPhysicalObjectName()
          Get the Physical table name in the target DB.
protected  java.util.Hashtable getRemapParameters()
          Get the remap parameters.
protected  java.lang.String getRemapXSLFile()
          Get the rempa XSL file.
 java.lang.String getReplaceTSpace()
          Return the replace table space.
 java.lang.String getTableOwner()
          Getter for the table schema.
 java.lang.String getTableSpaceType()
          Get the tablespace type.
 void getTableTypeInfo(oracle.xml.parser.v2.XMLDocumentFragment newInputXML)
          Get the table type information.
 void needRebuildIndexes(oracle.xml.parser.v2.XMLDocument inXMLDoc)
          Check to see whether need to rebuild indexes.
protected  java.lang.String prepareObjectQuery(java.util.ArrayList arguments)
          Prepare the query statement.
 int processGlobalTemporaryTable(oracle.xml.parser.v2.XMLDocumentFragment inXML)
          Drop the table first and then create the table again.
 oracle.xml.parser.v2.XMLDocumentFragment processObsoleteTableColumn(oracle.xml.parser.v2.XMLDocumentFragment inXML, boolean objectExists)
          Handling the table column when the obsolete flag is set If object does not exist in target db, remove the column form the xml.
 void setTableOwner(java.lang.String owner)
          Set the table owner.
 oracle.xml.parser.v2.XMLDocumentFragment validateDDL(oracle.xml.parser.v2.XMLDocumentFragment dddlXMLDoc)
          Validate DDL in the alter XMLDocumentFragment.
 
Methods inherited from class oracle.apps.fnd.applxdf.comp.DBObject
executeDDLStmt, getAlterDDLArrayToExecute, getAlterXML, getCreateDDLToExecute, getCreateDDLToExecute, getDependentDiffDocument, getObjectName, getTableSpaceType, getTargetTableSpaceName, isIndexExists, isObjectObsolete, readInputSXML, remapSXML, setObjDoc, setObjectName, setObjElm, stripRowTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableObject

public TableObject()
Constructor.


TableObject

public TableObject(Parameters param,
                   XDFLogger logger)
Constructor with arguments.

Parameters:
param - Parameters instance
logger - XDFLogger instance
Method Detail

getDataFromSXML

protected void getDataFromSXML(oracle.xml.parser.v2.XMLElement xmlElm)
Get the data from the XML Element.

Specified by:
getDataFromSXML in class DBObject
Parameters:
xmlElm - XML Element

prepareObjectQuery

protected java.lang.String prepareObjectQuery(java.util.ArrayList arguments)
Prepare the query statement.

Specified by:
prepareObjectQuery in class DBObject
Parameters:
arguments - arguments associated with the query statement
Returns:
query statement

getDataFromTargetDB

protected void getDataFromTargetDB(java.sql.ResultSet rset)
Get the data from target db.

Specified by:
getDataFromTargetDB in class DBObject
Parameters:
rset - resultset from the query

getRemapXSLFile

protected java.lang.String getRemapXSLFile()
Get the rempa XSL file.

Specified by:
getRemapXSLFile in class DBObject
Returns:
remap XSL file string

getRemapParameters

protected java.util.Hashtable getRemapParameters()
Get the remap parameters.

Specified by:
getRemapParameters in class DBObject
Returns:
remap parameters hashtable

getCreateDDLXSLFile

protected java.lang.String getCreateDDLXSLFile()
Get the create DDL XSL file.

Specified by:
getCreateDDLXSLFile in class DBObject
Returns:
create DDL XSL file string

getCreateDDLParameters

protected java.util.Hashtable getCreateDDLParameters()
Get the create DDL parameters.

Specified by:
getCreateDDLParameters in class DBObject
Returns:
create DDL parameters hashtable

getAlterXMLXSLFile

protected java.lang.String getAlterXMLXSLFile()
Get the alter XML XSL file.

Specified by:
getAlterXMLXSLFile in class DBObject
Returns:
alter XML XSL file string

getAlterXMLParameters

protected java.util.Hashtable getAlterXMLParameters()
Get the alter XML parameters

Overrides:
getAlterXMLParameters in class DBObject
Returns:
alter XML parameters

validateDDL

public oracle.xml.parser.v2.XMLDocumentFragment validateDDL(oracle.xml.parser.v2.XMLDocumentFragment dddlXMLDoc)
Validate DDL in the alter XMLDocumentFragment.

Specified by:
validateDDL in class DBObject
Parameters:
dddlXMLDoc - alter XMLDocumentFragment
Returns:
validated XMLDocumentFragment

getClauseTypeNotToEmit

protected java.util.HashMap getClauseTypeNotToEmit()
Get the clause type not to emit.

Specified by:
getClauseTypeNotToEmit in class DBObject
Returns:
cluase type hashmap not to emit

checkGlobalTemporaryDifferent

public boolean checkGlobalTemporaryDifferent()
Check to see whether the gloabl temprorary info from the xdf file is the same as those in the target db.

Returns:
true if the glbal temporary is different.

processGlobalTemporaryTable

public int processGlobalTemporaryTable(oracle.xml.parser.v2.XMLDocumentFragment inXML)
Drop the table first and then create the table again.

Parameters:
inXML - input xml document
Returns:
0 if success

getColumnList

public java.util.ArrayList getColumnList()
Get the column list.

Returns:
column list

getTableTypeInfo

public void getTableTypeInfo(oracle.xml.parser.v2.XMLDocumentFragment newInputXML)
Get the table type information.

Parameters:
newInputXML - input xml file
Throws:
java.lang.Exception - when get the vlaue of the tag

setTableOwner

public void setTableOwner(java.lang.String owner)
Set the table owner.

Parameters:
owner - owner string

getTableOwner

public java.lang.String getTableOwner()
Getter for the table schema.

Returns:
table schema

needRebuildIndexes

public void needRebuildIndexes(oracle.xml.parser.v2.XMLDocument inXMLDoc)
Check to see whether need to rebuild indexes.

Parameters:
inXMLDoc - input xml document

getNeedRebuildIndexes

public boolean getNeedRebuildIndexes()
Get the need rebuild index flag.

Returns:
true is needed to rebuild the index

doConstraints

public void doConstraints(boolean objExists,
                          boolean changeDB)
Process the constraints.

Parameters:
objExists - object exists in target db flag
changeDB - flag to indicate whether to apply the changes to db.

doCreateDDLConstraints

public void doCreateDDLConstraints(oracle.xml.parser.v2.XMLElement xElm)
Get the create table add constraint DDLs and add to arraylist.

Parameters:
xElm - xml element

getIsLogical

public java.util.HashMap getIsLogical(oracle.xml.parser.v2.XMLElement xmlElm)
Get the ISLOGICAL value for each constraint.


getCommentFromTable

public java.lang.String getCommentFromTable()
Get the comment from table.

Returns:
comment string

getCommentFromColumns

public void getCommentFromColumns(java.util.HashMap colsHashMap)
Get the comment from columns.

Parameters:
colsHashMap - column hash map

processObsoleteTableColumn

public oracle.xml.parser.v2.XMLDocumentFragment processObsoleteTableColumn(oracle.xml.parser.v2.XMLDocumentFragment inXML,
                                                                           boolean objectExists)
Handling the table column when the obsolete flag is set If object does not exist in target db, remove the column form the xml. If object exists in target db, make it nullable.

Parameters:
inXML - input xml document.
objectExists - object exists in target db or not
Returns:
the xml doc after the processing of the obsolete table columns.

getObsoleteColNames

public java.util.HashMap getObsoleteColNames()
Get the obsolete column names.

Returns:
obsolete column names

getReplaceTSpace

public java.lang.String getReplaceTSpace()
Return the replace table space.

Returns:
the replace table space

getTableSpaceType

public java.lang.String getTableSpaceType()
Get the tablespace type.

Returns:
tablespace type

getPhysicalObjectName

public java.lang.String getPhysicalObjectName()
Get the Physical table name in the target DB. Usually, physical object name is same as current objectName. But in the editioning view case, they could be different.

Returns:
String - the Physical name of the object

checkTargetDBObjectExists

public boolean checkTargetDBObjectExists()
Check whether the table Object exists in the target db or not. First check the dba editioning view to find corresponding ev; then using physical table name and schema to check if the table exists.

Overrides:
checkTargetDBObjectExists in class DBObject
Returns:
true if object exists in target db. Otherwise false.
Throws:
java.lang.Exception - when the statement or connection is closed

getDiffDocument

public oracle.sql.CLOB getDiffDocument(oracle.sql.CLOB tranformCLOB)
                                throws java.lang.Exception
Compare the difference of the two table documents and generate the difference CLOB.

Overrides:
getDiffDocument in class DBObject
Parameters:
tranformCLOB - CLOB to be compared to the target DB
Returns:
the CLOB of the differences of the two documents
Throws:
java.lang.Exception - when closing the statement

Oracle Fusion Middleware extensions for XML based Datamodel Framework
11g Release 1 (11.1.1.5)

E22566-01

Copyright © 2011 Oracle. All Rights Reserved.