com.ibm.commerce.foundation.dataload.object

Class TableDataObject

  • java.lang.Object
    • com.ibm.commerce.foundation.dataload.object.TableDataObject
  • Direct Known Subclasses:
    ExtendedTableDataObject


    public class TableDataObject
    extends java.lang.Object

    This class represents a row in a physical table.

    Each business object mediator must generate a list of TableDataObject to be persisted by a DataWriter.

    • Constructor Summary

      Constructors 
      Constructor and Description
      TableDataObject(java.lang.String aTableName)
      Constructor for creating a table data object, representing a table.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addColumnData(java.lang.String aColumnName, java.lang.Object aColumnValue)
      Add the column name and value to the column data map.
      void addMultipleColumnData(java.util.Map columnData)
      Add multiple column data to column data map.
      static TableDataObject findByPrimaryKey(java.lang.String tableName, java.util.Map primaryKeyData)
      Find a row from the table by primary key and return the populated TableDataObject.
      java.util.Map getColumnDataMap()
      This method returns the column data map.
      java.lang.String getColumnValue(java.lang.String aColumnName)
      Get the column value for a given column name.
      char getOpMode()
      Get the operation mode.
      java.lang.String getTableName()
      This method returns the table name.
      boolean isInsertForced()
      Checks if the flag is set.
      void setColumnDataMap(java.util.Map aColumnDataMap)
      This method sets the column data map.
      void setInsertForced(boolean insertForced)
      Sets the flag true or false
      void setOpMode(char anOpMode)
      Set the operation mode.
      void setTableName(java.lang.String aTableName)
      This method sets the table name.
      java.lang.String toString()
      Format the object to have a better display.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TableDataObject

        public TableDataObject(java.lang.String aTableName)

        Constructor for creating a table data object, representing a table. Table name should be in upper case.

        Parameters:
        aTableName - The table name of the table to be persisted to.
    • Method Detail

      • findByPrimaryKey

        public static TableDataObject findByPrimaryKey(java.lang.String tableName,
                                                       java.util.Map primaryKeyData)
                                                throws DataLoadException
        Find a row from the table by primary key and return the populated TableDataObject.
        Parameters:
        tableName - the table name
        primaryKeyData - a map containing the primary key name to the value map
        Returns:
        the populated TableDataObject, if the object is not found, a null will be return.
        Throws:
        DataLoadException - this error is thrown if the database throws the sql exception
      • getColumnDataMap

        public java.util.Map getColumnDataMap()

        This method returns the column data map. The key is the column name and value is the column value. All column names are in upper case.

        Returns:
        Map The column data map used to store column data for a table.
      • setColumnDataMap

        public void setColumnDataMap(java.util.Map aColumnDataMap)

        This method sets the column data map. The key is the column name and value is the column value. All column names are in upper case.

        Parameters:
        aColumnDataMap - The column data map used to store column data for a table.
      • getTableName

        public java.lang.String getTableName()

        This method returns the table name.

        Returns:
        String The table name for the table.
      • setTableName

        public void setTableName(java.lang.String aTableName)

        This method sets the table name.

        Parameters:
        aTableName - The table name for the table.
      • getOpMode

        public char getOpMode()

        Get the operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.

        Returns:
        char The operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.
      • setOpMode

        public void setOpMode(char anOpMode)

        Set the operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.

        Parameters:
        anOpMode - The operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.
      • getColumnValue

        public java.lang.String getColumnValue(java.lang.String aColumnName)

        Get the column value for a given column name. aColumnName is in upper case.

        Parameters:
        aColumnName - A column name to retrieve a value for.
        Returns:
        String The column value.
      • addColumnData

        public void addColumnData(java.lang.String aColumnName,
                                  java.lang.Object aColumnValue)

        Add the column name and value to the column data map. aColumnName is in upper case.

        Parameters:
        aColumnName - A column name.
        aColumnValue - A column value.
      • addMultipleColumnData

        public void addMultipleColumnData(java.util.Map columnData)

        Add multiple column data to column data map. The key in the columnData is the column name and the value is the column value. All column name are in upper cases.

        Parameters:
        columnData -
      • isInsertForced

        public boolean isInsertForced()
        Checks if the flag is set. If this flag is set, in the workspace environment, the AbstractBusinessObjectMediator will respect the insert operation mode set by the subclass. Otherwise, the super class will check it again and may reset the I to U.
        Returns:
        true if the flag is set.
      • setInsertForced

        public void setInsertForced(boolean insertForced)
        Sets the flag true or false
        Parameters:
        insertForced - the flag.
      • toString

        public java.lang.String toString()

        Format the object to have a better display.

        Overrides:
        toString in class java.lang.Object
        Returns:
        String The formatted string.