psdi.configure

Class SysDataElementMAXMESSAGES

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.jdom2.NamespaceAware, org.jdom2.Parent, UpgConstants


    public class SysDataElementMAXMESSAGES
    extends SysDataElement
    implements UpgConstants
    Element to represent the MAXMESSAGES table in the XML file that is output by BuildUpgMetadata and input to Upgrade. This is an extension of psdi.configure.SysDataElement.

    SysDataElementMAXMESSAGES is instanciated by the following:

    • When reading XML (Upgrade), instanciated from ConfigXMLFactory, via Upgrade. The SysDataElementMAXMESSAGES method getDeleteSql returns sql statements for deleting rows from the MAXMESSAGES table appropriately, after having run ConfigDB.
    See Also:
    SysDataElement, psdi.upgrade.BuildUpgMetadata, psdi.upgrade.Upgrade, Serialized Form
    • Constructor Detail

      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES()
      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES(java.lang.String name)
      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES(java.lang.String name,
                                         org.jdom2.Namespace namespace)
      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES(java.lang.String name,
                                         java.lang.String uri)
      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES(java.lang.String name,
                                         java.lang.String prefix,
                                         java.lang.String uri)
      • SysDataElementMAXMESSAGES

        public SysDataElementMAXMESSAGES(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
        This constructor is used when creating a new Element for the purpose of writing out XML. It calls buildFromHashMaps.
        Parameters:
        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.
        Throws:
        java.lang.Exception
        See Also:
        SysDataElement.scanKeyCols(), SysDataElement.buildFromHashMaps()
    • Method Detail

      • getDeleteSql

        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
        When reading XML, return a series of sql statements to update the customer's database.
        • If the XML status is OLDONLY, the sql will delete from table for that row.

        If different update logic is needed for a particular table, this class can be extended and this method overridden.

        Overrides:
        getDeleteSql in class SysDataElement
        Parameters:
        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.
        Returns:
        Series of sql statements
        Throws:
        java.lang.Exception
        See Also:
        SysDataElement.loadDoNotUpdateCols(), SysDataElement.scanKeyCols(), SysDataElementMAXMESSAGES.deleteRow(org.jdom2.Element, java.util.TreeMap)
      • deleteRow

        public java.util.ArrayList deleteRow(org.jdom2.Element row,
                                             java.util.TreeMap colsColno)
                                      throws java.lang.Exception
        When reading XML, and the row needs to be deleted from the customer's database, return the sql statement for deleting the row. Called from getDeleteSql. This is an extension of SysDataElement.deleteRow, as special processing is required for MaxMessages. Some messages were created with trailing spaces. SQL Server and DB2 cannot distinguish between values with trailing spaces and values without. We do it here programmatically with a call to verifyRow
        Parameters:
        row - The element from the input XML representing a row in this table.
        colsColno - The metadata for the columns on this table, key = colno.
        Returns:
        A "delete from..." sql statement. There will be no siteid/orgid condition, so it may delete multiple rows. 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.
        Throws:
        java.lang.Exception
        See Also:
        #verifyRow(Element, HashMap, TreeMap)}, SysDataElement.deleteRowExtension(org.jdom2.Element, java.util.ArrayList)