org.dbunit.database
Class PrimaryKeyFilteredTableWrapper

java.lang.Object
  extended by org.dbunit.database.PrimaryKeyFilteredTableWrapper
All Implemented Interfaces:
ITable

public class PrimaryKeyFilteredTableWrapper
extends java.lang.Object
implements ITable

This class is a wrapper for another table with the condition that only a subset of the original table will be available - the subset is defined by the set of primary keys that are allowed in the new table.

Since:
Sep 9, 2005
Version:
$Revision: 554 $
Author:
Felipe Leme

Field Summary
protected  org.slf4j.Logger logger
          logger
 
Fields inherited from interface org.dbunit.dataset.ITable
NO_VALUE
 
Constructor Summary
PrimaryKeyFilteredTableWrapper(ITable table, java.util.Set allowedPKs)
          Creates a PKFilteredTable given an original table and the allowed primary keys for that table.
 
Method Summary
 int getRowCount()
          Returns this table row count.
 ITableMetaData getTableMetaData()
          Returns this table metadata.
 java.lang.Object getValue(int row, java.lang.String column)
          Returns this table value for the specified row and column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
logger

Constructor Detail

PrimaryKeyFilteredTableWrapper

public PrimaryKeyFilteredTableWrapper(ITable table,
                                      java.util.Set allowedPKs)
                               throws DataSetException
Creates a PKFilteredTable given an original table and the allowed primary keys for that table.

Parameters:
table - original table
allowedPKs - primary keys allowed on the new table
Throws:
DataSetException - if something happened while getting the information
Method Detail

getTableMetaData

public ITableMetaData getTableMetaData()
Description copied from interface: ITable
Returns this table metadata.

Specified by:
getTableMetaData in interface ITable

getRowCount

public int getRowCount()
Description copied from interface: ITable
Returns this table row count.

Specified by:
getRowCount in interface ITable

getValue

public java.lang.Object getValue(int row,
                                 java.lang.String column)
                          throws DataSetException
Description copied from interface: ITable
Returns this table value for the specified row and column.

Specified by:
getValue in interface ITable
Throws:
NoSuchColumnException - if specfied column name do not exist in this table
RowOutOfBoundsException - if specfied row is less than zero or equals or greater than getRowCount
DataSetException


Copyright © 2002-2010. All Rights Reserved.