com.tivoli.twg.engine
Class TWGDbStoreRow

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGDbRow
      extended bycom.tivoli.twg.engine.TWGDbStoreRow
All Implemented Interfaces:
java.io.Serializable

public class TWGDbStoreRow
extends TWGDbRow
implements java.io.Serializable

TWGDbStoreRow encapsulates an update or insert of a database table row. It is used as a parameter for the store row command as well as the replace managed object command. Each value added to the row represents the column name and value.

See Also:
Serialized Form

Constructor Summary
protected TWGDbStoreRow(byte[] buf, java.lang.String version)
          This method is public as an implementation side effect.
  TWGDbStoreRow(java.lang.String table)
          Constructor for the table row.
 
Method Summary
 void addColumnValue(java.lang.String column_token, double value)
          Add a double column value to the row.
 void addColumnValue(java.lang.String column_token, float value)
          Add a float column value to the row (database Real column)
 void addColumnValue(java.lang.String column_token, int value)
          Add an integer column value to the row.
 void addColumnValue(java.lang.String column_token, long value)
          Add a long column value to the row (database Date and Datetime columns)
 void addColumnValue(java.lang.String column_token, java.lang.Object value)
          Add a column token name and an Object value to the row.
 void addColumnValue(java.lang.String column_token, short value)
          Add a short column value to the row (database Smallint columns)
 void addColumnValue(java.lang.String column_token, java.lang.String value)
          Add a string column value to the row (Character and Character Varying Columns)
 Vect getColumns()
          Get a vector of all the columns token names in the row
 boolean getDeleteOnly()
          Get delete-only flag
protected  int getIntelByteBufferSize()
          This method is protected as an implementation side effect.
 java.lang.String getTableName()
          Get the token name of the database table.
 boolean getUpdateOnly()
          Get update-only flag
 void setDeleteOnly(boolean flg)
          Set delete-only flag: if set, delete is only done
protected  void setIntelByteBufferParms(Command cmd, java.lang.String version)
          This method is public as an implementation side effect.
 void setUpdateOnly(boolean flg)
          Set update-only flag: if set, insert is not attempted before update
 
Methods inherited from class com.tivoli.twg.engine.TWGDbRow
addColumnValue, addColumnValue, addColumnValue, addColumnValue, addColumnValue, addColumnValue, addColumnValue, getBufferLen, getNumValues, getValueAt, getValues, initParmsByBuf, initParmsByBuf, setBufferParms, setColumnValue, setColumnValue, setColumnValue, setColumnValue, setColumnValue, setColumnValue, setColumnValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGDbStoreRow

public TWGDbStoreRow(java.lang.String table)
Constructor for the table row. Use addColumnValue to add the values for each column to be updated.

Parameters:
table - - Database table token name

TWGDbStoreRow

protected TWGDbStoreRow(byte[] buf,
                        java.lang.String version)
                 throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Constructor for the building the row from an IntelByteBuffer format of the command

Parameters:
buf - - the rows in IntelByteBufferFormat
version - - the database version (e.g. TWGDatabase.VERSION)
Throws:
- - TWGDbException thrown for parameter or version errors
TWGDbException
Method Detail

setIntelByteBufferParms

protected void setIntelByteBufferParms(Command cmd,
                                       java.lang.String version)
                                throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Build IntelByteBuffer parm version of this row and it to the IPC command

Parameters:
cmd - - the IPC command whose input parameters will be set by this method
Throws:
- - TWGDbException thrown for parameter or version errors
TWGDbException

getIntelByteBufferSize

protected int getIntelByteBufferSize()
                              throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Determines the IntelByteBuffer size for this row

Returns:
- size of buffer needed
Throws:
TWGDbException

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           java.lang.Object value)
Add a column token name and an Object value to the row.

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           java.lang.String value)
Add a string column value to the row (Character and Character Varying Columns)

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           int value)
Add an integer column value to the row.

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           short value)
Add a short column value to the row (database Smallint columns)

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           long value)
Add a long column value to the row (database Date and Datetime columns)

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           float value)
Add a float column value to the row (database Real column)

Parameters:
column_token - - the token name for the column
value - - the value for the column

addColumnValue

public void addColumnValue(java.lang.String column_token,
                           double value)
Add a double column value to the row.

Parameters:
column_token - - the token name for the column
value - - the value for the column

getTableName

public java.lang.String getTableName()
Get the token name of the database table.

Returns:
the table token name

getColumns

public Vect getColumns()
Get a vector of all the columns token names in the row

Returns:
the vector of column token names

setUpdateOnly

public void setUpdateOnly(boolean flg)
Set update-only flag: if set, insert is not attempted before update

Parameters:
flg - - update flag value (true=no insert before update)

getUpdateOnly

public boolean getUpdateOnly()
Get update-only flag

Returns:
true if no insert should be done (only update)

setDeleteOnly

public void setDeleteOnly(boolean flg)
Set delete-only flag: if set, delete is only done

Parameters:
flg - - delete flag value (true=delete only)

getDeleteOnly

public boolean getDeleteOnly()
Get delete-only flag

Returns:
true if delete should be done (no insert/update)