org.dbunit.dataset
Interface ITableMetaData

All Known Implementing Classes:
AbstractTableMetaData, DatabaseTableMetaData, DefaultTableMetaData, FilteredTableMetaData, LowerCaseTableMetaData, ResultSetTableMetaData

public interface ITableMetaData

Represents table metadata.

Since:
Feb 17, 2002
Version:
$Revision: 741 $
Author:
Manuel Laflamme

Method Summary
 int getColumnIndex(String columnName)
          Returns the column's array index of the column with the given name within this table metadata.
 Column[] getColumns()
          Returns this table columns as recognized by dbunit.
 Column[] getPrimaryKeys()
          Returns this table primary key columns.
 String getTableName()
          Returns this table name.
 

Method Detail

getTableName

String getTableName()
Returns this table name.

Returns:
this table name

getColumns

Column[] getColumns()
                    throws DataSetException
Returns this table columns as recognized by dbunit. In cases where columns are resolved using database metadata it can happen that an empty array is returned when a table does not have a single column that is recognized by the configured IDataTypeFactory. Note that it is not an exceptional case within dbunit when a ITableMetaData does not have a column.

Returns:
The columns for this table
Throws:
DataSetException

getPrimaryKeys

Column[] getPrimaryKeys()
                        throws DataSetException
Returns this table primary key columns.

Returns:
this table primary key columns.
Throws:
DataSetException

getColumnIndex

int getColumnIndex(String columnName)
                   throws DataSetException
Returns the column's array index of the column with the given name within this table metadata.

Parameters:
columnName - The name of the column that is searched
Returns:
The index of the given column within this metadata, starting with 0 for the first column
Throws:
NoSuchColumnException - if the given column has not been found
DataSetException - if something goes wrong when trying to retrieve the columns
Since:
2.3.0


Copyright © 2002-2012. All Rights Reserved.