public class SysDataElementSYNONYMDOMAIN extends SysDataElement implements UpgConstants
psdi.configure.SysDataElement
.
SysDataElementSYNONYMDOMAIN is instanciated by the following:
compareSystemData
.
The constructor will populate the SysDataElementSYNONYMDOMAIN object appropriately.
ConfigXMLFactory
, via
Upgrade
.
The SysDataElementSYNONYMDOMAIN method getSql
returns sql statements for populating the data tables appropriately, after having run ConfigDB.
Multisite functionality is handled by the presence or absence of siteid/orgid in the primary unique index.
The default processing in SysDataElementSYNONYMDOMAIN presumes that the columns in the primary unique
index have not changed from the old to the new database. If the index has changed, this class
will have to be extended, with the new instance residing in the subdirectory with the old
database name. For example, if the key to the table changed after 5.2, you will need a
class psdi.configure.V520.SysDataElementSYNONYMDOMAIN
. The extension can then
perform the processing needed to support the key structure conversion between specific releases.
SysDataElement
,
psdi.upgrade.BuildUpgMetadata
,
psdi.upgrade.Upgrade
,
Serialized FormcodeElements, con, doNotUpdateCols, keyCols, newCol, newData, newDataOldKeys, oldCol, oldData, orgidKey, orgs, siteidKey, sites, sNo, status, sYes, tbname, util
DB2, doNotUpdateACTION, doNotUpdateALNDOMAIN, doNotUpdateAPPLICATIONAUTH, doNotUpdateAUTOKEY, doNotUpdateCONDITION, doNotUpdateCONTRACTPROPERTY, doNotUpdateCONTRACTTYPE, doNotUpdateCROSSOVERDOMAIN, doNotUpdateDOCTYPES, doNotUpdateLANGUAGE, doNotUpdateMAXAPPS, doNotUpdateMAXCONDDETAIL, doNotUpdateMAXCONTROLVALUE, doNotUpdateMAXDOMAIN, doNotUpdateMAXLOGAPPENDER, doNotUpdateMAXLOGGER, doNotUpdateMAXMENU, doNotUpdateMAXMESSAGES, doNotUpdateMAXMODULES, doNotUpdateMAXPROP, doNotUpdateMAXPROPVALUE, doNotUpdateMAXROLE, doNotUpdateMAXSEQUENCE, doNotUpdateMAXSERSECURITY, doNotUpdateMAXSERVICE, doNotUpdateMAXTABLEDOMAIN, doNotUpdateMAXVARS, doNotUpdateMAXVARTYPE, doNotUpdateMXCOLLAB, doNotUpdateMXCOLLABREF, doNotUpdateNUMERICDOMAIN, doNotUpdateNUMRANGEDOMAIN, doNotUpdatePORTLET, doNotUpdatePRICALC, doNotUpdateSECURITYRESTRICT, doNotUpdateSIGOPTION, doNotUpdateSYNONYMDOMAIN, doNotUpdateTAXTYPE, doNotUpdateWORKPRIORITY, doNotUpdateWORKTYPE, doNotUpdateWPEDITSETTING, messageCache, NEWONLY, OLDANDNEW, OLDONLY, ORACLE, SQLINET, SQLMICROSOFT, SQLSERVER, SYSDATATABLES, SYSTEMTABLES, UNKNOWN
Constructor and Description |
---|
SysDataElementSYNONYMDOMAIN() |
SysDataElementSYNONYMDOMAIN(java.lang.String name) |
SysDataElementSYNONYMDOMAIN(java.lang.String name,
org.jdom.Namespace namespace) |
SysDataElementSYNONYMDOMAIN(java.lang.String name,
java.lang.String uri) |
SysDataElementSYNONYMDOMAIN(java.lang.String name,
java.lang.String prefix,
java.lang.String uri) |
SysDataElementSYNONYMDOMAIN(java.lang.String tbname,
java.util.TreeMap newCol,
java.util.TreeMap oldCol,
java.util.TreeMap newData,
java.util.TreeMap oldData,
java.util.TreeMap newDataOldKeys,
java.util.TreeMap keyCols,
java.io.File codefile)
This constructor is used when creating a new Element for the purpose
of writing out XML.
|
Modifier and Type | Method and Description |
---|---|
void |
addOneRow(java.lang.String key,
java.util.HashMap newVals)
When generating XML, and the column exists only in the new database, this method is used
to add its attributes.
|
void |
buildFromHashMaps()
When generating XML, given the TreeMaps
newData and oldData ,
build the elements needed to be output from BuildUpgMetadata. |
java.util.ArrayList |
compareRows(org.jdom.Element row,
java.util.TreeMap colsColno)
When reading XML, this method determines what updates or inserts are needed.
|
void |
compareRows(java.lang.String key,
java.util.HashMap newVals,
java.util.HashMap oldVals)
When generating XML, and the key exists both the new and old database, this method is used
to compare and add its attributes to this SysDataElementSYNONYMDOMAIN, when the values are different.
|
java.util.ArrayList |
deleteRow(org.jdom.Element row)
When reading XML, and the row needs to be deleted from the customer's database,
return the sql statement for deleting the row.
|
java.util.ArrayList |
getDeleteSql(java.lang.String tbname,
java.sql.Connection con,
Util util,
java.util.TreeMap oldCol,
java.util.TreeMap keyCols)
When reading XML, return a series of sql statements to update the customer's database.
|
java.util.ArrayList |
getSql(java.lang.String tbname,
java.sql.Connection con,
Util util,
java.util.TreeMap oldCol,
java.util.TreeMap keyCols)
When reading XML, return a series of sql statements to update the customer's database.
|
java.lang.String |
getWhereClause(org.jdom.Element row,
boolean useSiteOrg,
java.lang.String siteid,
java.lang.String orgid)
When reading XML, generate the Where clause to use in a Sql statement (for delete or update).
|
boolean |
haveDup(org.jdom.Element checkEl)
When generating XML, before adding an element, check to see if we already have a duplicate.
|
java.util.ArrayList |
insertRow(org.jdom.Element row,
java.lang.String siteid,
java.lang.String orgid)
When reading XML, and the row needs to be added to the customer's database,
this method returns the Sql statement for inserting the row.
|
void |
removeOneRow(java.lang.String key,
java.util.HashMap oldVals)
When generating XML, and the column exists only in the old database, this method is used
to indicate its removal.
|
void |
setKeyAttributes(org.jdom.Element row,
java.util.HashMap rowValues)
When generating XML, create attributes where name = column name and value = column value,
for each column in the primary unique index.
|
java.util.ArrayList |
updateRow(org.jdom.Element row,
java.util.HashMap currentData,
java.lang.String siteid,
java.lang.String orgid)
When reading XML, and the row needs to be updated on the customer's database,
this method returns the Sql statement for updating the row.
|
addCodes, addCodesExtension, canUpdateColumn, deleteRowExtension, domainInUse, executeQuery, getAttribute, getChunkUpdates, getKeys, getMaxReserved, getNextVal, getSequenceName, getStatus, getTableName, getUpgCodesElement, initSequence, insertRowExtension, isUniqueColumnID, loadDoNotUpdateCols, scanKeyCols, setStatus, setTableName, setUpgCodes, updateRowExtension
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText, toString
public SysDataElementSYNONYMDOMAIN()
public SysDataElementSYNONYMDOMAIN(java.lang.String name, org.jdom.Namespace namespace)
public SysDataElementSYNONYMDOMAIN(java.lang.String name)
public SysDataElementSYNONYMDOMAIN(java.lang.String name, java.lang.String uri)
public SysDataElementSYNONYMDOMAIN(java.lang.String name, java.lang.String prefix, java.lang.String uri)
public SysDataElementSYNONYMDOMAIN(java.lang.String tbname, java.util.TreeMap newCol, java.util.TreeMap oldCol, java.util.TreeMap newData, java.util.TreeMap oldData, java.util.TreeMap newDataOldKeys, java.util.TreeMap keyCols, java.io.File codefile) throws java.lang.Exception
buildFromHashMaps
.tbname
- The name of the table.
See tbname
.newCol
- The column metadata on this table, from the new database.
See newCol
.oldCol
- The column metadata on this table, from the old database.
See oldCol
.newData
- The data from the new database.
See newData
.oldData
- The data from the old database.
See oldData
.keyCols
- Key columns for this table.
See keyCols
.codeFile
- The file UpgCodes.xml that may contain special codes for rows in the table.
For SysDataElementSYNONYMDOMAIN this is null.java.lang.Exception
SysDataElement.scanKeyCols()
,
buildFromHashMaps()
public void buildFromHashMaps() throws java.lang.Exception
SysDataElement
newData
and oldData
,
build the elements needed to be output from BuildUpgMetadata.buildFromHashMaps
in class SysDataElement
java.lang.Exception
SysDataElement.addOneRow(java.lang.String, java.util.HashMap)
,
SysDataElement.removeOneRow(java.lang.String, java.util.HashMap)
,
SysDataElement.compareRows(String, HashMap, HashMap)
public void addOneRow(java.lang.String key, java.util.HashMap newVals) throws java.lang.Exception
addOneRow
in class SysDataElement
key
- The key to this row. Format is described in
getData
.newVals
- An entry from the newData
TreeMap, which specifies the
data for this row.java.lang.Exception
setKeyAttributes(org.jdom.Element, java.util.HashMap)
,
haveDup(org.jdom.Element)
,
SysDataElement.addCodes(org.jdom.Element, java.lang.String)
public void removeOneRow(java.lang.String key, java.util.HashMap oldVals) throws java.lang.Exception
removeOneRow
in class SysDataElement
key
- The key of the row being removed. Columns are delimited by "|".
Format is described in getData
.oldVals
- An entry from the oldData
TreeMap, which specifies the
data for this row.java.lang.Exception
setKeyAttributes(org.jdom.Element, java.util.HashMap)
,
haveDup(org.jdom.Element)
public void compareRows(java.lang.String key, java.util.HashMap newVals, java.util.HashMap oldVals) throws java.lang.Exception
compareRows
in class SysDataElement
key
- The key of the row being compared. Columns are delimited by "|".
Format is described in getData
.newVals
- An entry from the newData
TreeMap, which specifies the
data for this row in the new database.oldVals
- An entry from the oldData
TreeMap, which specifies the
data for this row in the old database.java.lang.Exception
SysDataElement.canUpdateColumn(java.lang.String)
,
setKeyAttributes(org.jdom.Element, java.util.HashMap)
,
haveDup(org.jdom.Element)
,
SysDataElement.addCodes(org.jdom.Element, java.lang.String)
public void setKeyAttributes(org.jdom.Element row, java.util.HashMap rowValues) throws java.lang.Exception
keyCols
.setKeyAttributes
in class SysDataElement
row
- The Element representing a particular row in the table.rowValues
- The HashMap of the data values for this row.java.lang.Exception
public boolean haveDup(org.jdom.Element checkEl) throws java.lang.Exception
haveDup
in class SysDataElement
checkEl
- The element that we've constructed but not yet added.java.lang.Exception
public java.util.ArrayList getSql(java.lang.String tbname, java.sql.Connection con, Util util, java.util.TreeMap oldCol, java.util.TreeMap keyCols) throws java.lang.Exception
getSql
in class SysDataElement
tbname
- The table name.
See tbname
.con
- The connection to the database being upgraded.
See con
.util
- Reference to the Util class.
See util
.oldCol
- TreeMap of the data structure for the columns on this table (key = column name).
(This is retrieved AFTER ConfigDB may have updated the format.)
See oldCol
.keyCols
- The key columns for this table.
See keyCols
.java.lang.Exception
SysDataElement.scanKeyCols()
,
compareRows(Element, TreeMap)
public java.util.ArrayList getDeleteSql(java.lang.String tbname, java.sql.Connection con, Util util, java.util.TreeMap oldCol, java.util.TreeMap keyCols) throws java.lang.Exception
getDeleteSql
in class SysDataElement
tbname
- The table name.
See tbname
.con
- The connection to the database being upgraded.
See con
.util
- Reference to the Util class.
See util
.oldCol
- TreeMap of the data structure for the columns on this table (key = column name).
(This is retrieved AFTER ConfigDB may have updated the format.)
See oldCol
.keyCols
- The key columns for this table.
See keyCols
.java.lang.Exception
SysDataElement.scanKeyCols()
,
deleteRow(org.jdom.Element)
public java.lang.String getWhereClause(org.jdom.Element row, boolean useSiteOrg, java.lang.String siteid, java.lang.String orgid) throws java.lang.Exception
keyCols
to identify the names of the key columns.getWhereClause
in class SysDataElement
row
- The Element representing a row in the database.useSiteOrg
- If the primary key includes siteid and/or orgid, and this param is True,
then the value or siteid/orgid will be included in the Where clause.
If this param is False, or the primary key does not contain siteid/orgid, then
the Where clause will not have any constraint for siteid/orgid.siteid
- If this is null, and the Where clause includes siteid, the method uses
the siteid from the row Element, otherwise it uses the value of this param.
If this equals the empty string (""), the Where clause will specify "siteid is null".orgid
- If this is null, and the Where clause includes orgid, the method uses
the orgid from the row Element, otherwise it uses the value of this param.
If this equals the empty string (""), the Where clause will specify "orgid is null".java.lang.Exception
public java.util.ArrayList compareRows(org.jdom.Element row, java.util.TreeMap colsColno) throws java.lang.Exception
getSql
.
Where siteid or orgid exists in the table's key, this method will loop through
the customer's sites/orgs and provide appropriate values, potentially generating
more than one sql statement per XML row.compareRows
in class SysDataElement
row
- The element from the input XML representing a row in the table.colsColno
- The metadata for the columns on the table, key = colno.java.lang.Exception
getWhereClause(org.jdom.Element, boolean, java.lang.String, java.lang.String)
,
Util.getData(java.lang.String, java.util.TreeMap, java.lang.String)
,
updateRow(org.jdom.Element, java.util.HashMap, java.lang.String, java.lang.String)
,
insertRow(org.jdom.Element, java.lang.String, java.lang.String)
public java.util.ArrayList deleteRow(org.jdom.Element row) throws java.lang.Exception
getSql
.deleteRow
in class SysDataElement
row
- The element from the input XML representing a row in this table.
This is an ArrayList so that extensions of this class can provide more than
one Sql statement if needed, e.g. for parent/child tables.java.lang.Exception
SysDataElement.deleteRowExtension(org.jdom.Element, java.util.ArrayList)
public java.util.ArrayList updateRow(org.jdom.Element row, java.util.HashMap currentData, java.lang.String siteid, java.lang.String orgid) throws java.lang.Exception
compareRows
.updateRow
in class SysDataElement
row
- The element from the input XML representing a row in the table.currentData
- The data currently on the customer's database (one row).siteid
- The siteid to use in the Where clause (if any).orgid
- The orgid to use in the Where clause (if any).java.lang.Exception
SysDataElement.canUpdateColumn(java.lang.String)
public java.util.ArrayList insertRow(org.jdom.Element row, java.lang.String siteid, java.lang.String orgid) throws java.lang.Exception
compareRows
.insertRow
in class SysDataElement
row
- The element from the input XML representing a row in the table.siteid
- The siteid to use in the Insert statement (if any).orgid
- The orgid to use in the Insert statement (if any).java.lang.Exception
SysDataElement.insertRowExtension(org.jdom.Element, java.lang.String, java.lang.String, java.util.ArrayList)