net.sourceforge.sqlunit.beans
Class BatchDatabaseResult

java.lang.Object
  extended by net.sourceforge.sqlunit.beans.BatchDatabaseResult

public class BatchDatabaseResult
extends java.lang.Object

The BatchDatabaseResult represents the output from a batch update operation.

Version:
$Revision: 1.6 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
BatchDatabaseResult()
          Instantiates a BatchDatabaseResult object.
 
Method Summary
 void addUpdateCount(int updateCount)
          Allows setting of the update count from a specified integer value.
 void addUpdateCount(java.lang.String updateCountString)
          Allows setting of the update count from a specified numeric value or one of the two acceptable symbolic values.
 int getActualCount()
          Returns the size of the underlying List of updateCounts.
 int getExpectedCount()
          Returns the expectedCount attribute from the BatchDatabaseResult object.
 int getFailedAtIndex()
          Returns the zero-based index into the BatchDatabaseResult object where the fist failure is expected to occur.
 java.lang.String getUpdateCountAt(int index)
          Returns the update count at the index into the BatchDatabaseResult object.
 void resetUpdateCounts()
          Removes all the update counts from the underlying List object.
static void setException(java.sql.BatchUpdateException exception)
          Sets the batch exception into the result object.
 void setExpectedCount(int expectedCount)
          Sets the expectedCount attribute from the BatchDatabaseResult object.
 void setFailedAtIndex(int failedAtIndex)
          Sets the zero-based index into the BatchDatabaseResult object where the fist failure is expected to occur.
 org.jdom.Element toElement()
          Returns the BatchDatabaseResult object as a JDOM Element.
 java.lang.String toString()
          Returns the String representation of the BatchDatabaseResult object by converting it from its internal format to a JDOM Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BatchDatabaseResult

public BatchDatabaseResult()
Instantiates a BatchDatabaseResult object.

Method Detail

getExpectedCount

public final int getExpectedCount()
Returns the expectedCount attribute from the BatchDatabaseResult object.

Returns:
the expected number of results for this object.

setExpectedCount

public final void setExpectedCount(int expectedCount)
Sets the expectedCount attribute from the BatchDatabaseResult object.

Parameters:
expectedCount - the expected number of results for this object.

getFailedAtIndex

public final int getFailedAtIndex()
Returns the zero-based index into the BatchDatabaseResult object where the fist failure is expected to occur.

Returns:
the index into the object where the first failure is expected.

setFailedAtIndex

public final void setFailedAtIndex(int failedAtIndex)
Sets the zero-based index into the BatchDatabaseResult object where the fist failure is expected to occur.

Parameters:
failedAtIndex - zero-based index where the failure is expected.

getActualCount

public final int getActualCount()
Returns the size of the underlying List of updateCounts.

Returns:
the actual size of this BatchDatabaseResult object.

getUpdateCountAt

public final java.lang.String getUpdateCountAt(int index)
Returns the update count at the index into the BatchDatabaseResult object. The index is zero-based.

Parameters:
index - the index into the BatchDatabaseResult object.
Returns:
the update count at the index, or -1 if not found.

addUpdateCount

public final void addUpdateCount(int updateCount)
Allows setting of the update count from a specified integer value.

Parameters:
updateCount - an integer value to set.

addUpdateCount

public final void addUpdateCount(java.lang.String updateCountString)
Allows setting of the update count from a specified numeric value or one of the two acceptable symbolic values. It also does variable substitution if the value supplied is a variable.

Parameters:
updateCountString - the specified value of the update count.

resetUpdateCounts

public final void resetUpdateCounts()
Removes all the update counts from the underlying List object.


setException

public static final void setException(java.sql.BatchUpdateException exception)
Sets the batch exception into the result object.

Parameters:
exception - the BatchUpdateException object to set.

toElement

public final org.jdom.Element toElement()
Returns the BatchDatabaseResult object as a JDOM Element.

Returns:
the BatchDatabaseResult as a JDOM Element.

toString

public final java.lang.String toString()
Returns the String representation of the BatchDatabaseResult object by converting it from its internal format to a JDOM Element.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the BatchDatabaseResult object.