com.ibm.db
Class StatementResultRow

java.lang.Object
  |
  +--com.ibm.db.StatementResultRow

class StatementResultRow
extends java.lang.Object
implements java.io.Serializable

StatementResultRow represents a row in the cache.

See Also:
Serialized Form

Field Summary
protected  int action
           
private static java.lang.String copyright
           
protected  DatabaseRow currentColumnValues
           
static int DELETED
           
protected  boolean inDatabase
           
static int INSERTED
           
static int NEW
           
static int NONE
           
protected  int numberWhenChanged
           
protected  DatabaseRow previousColumnValues
           
(package private) static long serialVersionUID
           
protected  int status
           
static int TRUNCATED
           
static int UNCHANGED
           
static int UPDATED
           
static int VALUE_SET
           
 
Constructor Summary
StatementResultRow(DatabaseRow aRow)
          Constructs a new StatementResultRow and sets the current column values to the passed DatabaseRow.
StatementResultRow(StatementResultRow aRow)
          Consturcts a new StatementResultRow which is a clone of the StatementResultRow passed.
 
Method Summary
 java.lang.Object copyValue(java.lang.Object aValue)
          This method was created in VisualAge.
 int getAction()
          Returns one of the following values that describe the action to perform on this row in the cache: NONE, UPDATED, INSERTED, DELETED.
 java.lang.Object getColumnValue(int columnNumber)
          Returns the current value of the specified column.
 java.lang.Object getColumnValue(java.lang.String columnName)
          Returns the current value of the specified column.
 DatabaseRow getCurrentColumnValues()
          Returns the current column values.
protected  int getNumberWhenChanged()
          This method was created by a SmartGuide.
 java.lang.Object getPreviousColumnValue(int columnNumber)
          Returns the previous value of the specified column value.
 DatabaseRow getPreviousColumnValues()
          Returns the previous column values.
 int getStatus()
          Returns the status of the result row.
 boolean isInDatabase()
          Returns true if the row in the cache represents a row that is already in the database.
 void reset()
          Resets the status of the row.
 void restore()
          Restores the row's values to those last known to be in the database.
 void setAction(int anAction)
          Sets the action to be performed on this row: NONE, UPDATED, INSERTED, DELETED.
 void setColumnValue(int columnNumber, java.lang.Object aValue)
          Sets the current value of the specified column to the specified value.
 void setInDatabase(boolean aValue)
          If true, the row is already in the database.
protected  void setNumberWhenChanged(int rowNumber)
          This method was created by a SmartGuide.
 void setStatus(int aStatus)
          Sets the status of the row: UNCHANGED, NEW, VALUE_SET, or TRUNCATED.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

currentColumnValues

protected DatabaseRow currentColumnValues

previousColumnValues

protected DatabaseRow previousColumnValues

status

protected int status

action

protected int action

inDatabase

protected boolean inDatabase

numberWhenChanged

protected int numberWhenChanged

UNCHANGED

public static final int UNCHANGED

VALUE_SET

public static final int VALUE_SET

NEW

public static final int NEW

TRUNCATED

public static final int TRUNCATED

NONE

public static final int NONE

UPDATED

public static final int UPDATED

DELETED

public static final int DELETED

INSERTED

public static final int INSERTED

serialVersionUID

static final long serialVersionUID

copyright

private static final java.lang.String copyright
Constructor Detail

StatementResultRow

public StatementResultRow(DatabaseRow aRow)
Constructs a new StatementResultRow and sets the current column values to the passed DatabaseRow.
Parameters:
aRow - the current column values

StatementResultRow

public StatementResultRow(StatementResultRow aRow)
                   throws DataException
Consturcts a new StatementResultRow which is a clone of the StatementResultRow passed.
Parameters:
aRow - the result row to be cloned
Method Detail

copyValue

public java.lang.Object copyValue(java.lang.Object aValue)
This method was created in VisualAge.
Parameters:
aValue - java.lang.Object
Returns:
java.lang.Object

getAction

public int getAction()
Returns one of the following values that describe the action to perform on this row in the cache: NONE, UPDATED, INSERTED, DELETED.
Returns:
NONE, UPDATED, INSERTED, or DELETED
See Also:
setAction(int)

getColumnValue

public java.lang.Object getColumnValue(int columnNumber)
Returns the current value of the specified column.
Parameters:
columnNumber - the index of the column
Returns:
the column value
Throws:
java.lang.IndexOutOfBoundsException - if the column index is not defined
See Also:
setColumnValue(int, java.lang.Object)

getColumnValue

public java.lang.Object getColumnValue(java.lang.String columnName)
Returns the current value of the specified column.
Parameters:
columnName - the name of the column
Returns:
the column value
Throws:
java.lang.IndexOutOfBoundsException - if the column name is not defined
See Also:
setColumnValue(int, java.lang.Object)

getCurrentColumnValues

public DatabaseRow getCurrentColumnValues()
Returns the current column values.
Returns:
the current column values

getNumberWhenChanged

protected int getNumberWhenChanged()
This method was created by a SmartGuide.
Returns:
int

getPreviousColumnValue

public java.lang.Object getPreviousColumnValue(int columnNumber)
Returns the previous value of the specified column value.
Parameters:
columnNumber - the index of the column
Returns:
the previous column value
Throws:
java.lang.IndexOutOfBoundsException - if the column index is not defined

getPreviousColumnValues

public DatabaseRow getPreviousColumnValues()
Returns the previous column values.
Returns:
the previous column values

getStatus

public int getStatus()
Returns the status of the result row. The possible values are UNCHANGED, NEW, or VALUE_SET.
Returns:
UNCHANGED, NEW or VALUE_SET
See Also:
setStatus(int)

isInDatabase

public boolean isInDatabase()
Returns true if the row in the cache represents a row that is already in the database. If SelectResult.newRow has been used to insert this row into the cache, it returns false.
Returns:
true if the row in the cache represents a row that is already in the database, otherwise false.
See Also:
setInDatabase(boolean)

reset

public void reset()
Resets the status of the row. Sets the previous column values to null, the status to UNCHANGED and the action to NONE.

restore

public void restore()
Restores the row's values to those last known to be in the database.

setAction

public void setAction(int anAction)
Sets the action to be performed on this row: NONE, UPDATED, INSERTED, DELETED.
Parameters:
action - NONE, UPDATED, INSERTED, DELETED
See Also:
getAction()

setColumnValue

public void setColumnValue(int columnNumber,
                           java.lang.Object aValue)
                    throws DataException,
                           DataException
Sets the current value of the specified column to the specified value. If the current status of the row is UNCHANGED, the current column values are saved as the previous column values. The status of the row is changed to VALUE_SET.
Parameters:
columnNumber - the index of the column
aValue - the column value
Throws:
java.lang.IndexOutOfBoundsException - if the column index is not defined
DataException - if the specified value does not match the object type for the column
DataException - truncated - if data truncation occurred on retrieval.
See Also:
getColumnValue(int)

setInDatabase

public void setInDatabase(boolean aValue)
If true, the row is already in the database. Otherwise the row has been inserted into the cache.
Parameters:
aValue - true if the row is in the database; false if the row has been inserted into the cache.
See Also:
#getInDatabase

setNumberWhenChanged

protected void setNumberWhenChanged(int rowNumber)
This method was created by a SmartGuide.
Parameters:
rowNumber - int

setStatus

public void setStatus(int aStatus)
Sets the status of the row: UNCHANGED, NEW, VALUE_SET, or TRUNCATED.
Parameters:
aStatus - UNCHANGED, NEW, VALUE_SET, or TRUNCATED
See Also:
getStatus()