org.dbunit.dataset
Class AbstractTableMetaData

java.lang.Object
  extended by org.dbunit.dataset.AbstractTableMetaData
All Implemented Interfaces:
ITableMetaData
Direct Known Subclasses:
DatabaseTableMetaData, DefaultTableMetaData, FilteredTableMetaData, LowerCaseTableMetaData, ResultSetTableMetaData

public abstract class AbstractTableMetaData
extends Object
implements ITableMetaData

Since:
Mar 8, 2002
Version:
$Revision: 796 $
Author:
Manuel Laflamme

Nested Class Summary
static class AbstractTableMetaData.DataTypeFactoryValidator
          Utility to validate a given IDataTypeFactory against a given physical database system.
 
Constructor Summary
AbstractTableMetaData()
          Default constructor
 
Method Summary
 int getColumnIndex(String columnName)
          Provides the index of the column with the given name within this table.
 IDataTypeFactory getDataTypeFactory(IDatabaseConnection connection)
          Validates and returns the datatype factory of the given connection
protected static Column[] getPrimaryKeys(Column[] columns, String[] keyNames)
          Deprecated. since 2.3.0 - use Columns.getColumns(String[], Column[])
protected static Column[] getPrimaryKeys(String tableName, Column[] columns, IColumnFilter columnFilter)
          Deprecated. since 2.3.0 - use Columns.getColumns(String[], Column[])
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dbunit.dataset.ITableMetaData
getColumns, getPrimaryKeys, getTableName
 

Constructor Detail

AbstractTableMetaData

public AbstractTableMetaData()
Default constructor

Method Detail

getPrimaryKeys

protected static Column[] getPrimaryKeys(Column[] columns,
                                         String[] keyNames)
Deprecated. since 2.3.0 - use Columns.getColumns(String[], Column[])

Parameters:
columns -
keyNames -
Returns:
The primary key columns

getPrimaryKeys

protected static Column[] getPrimaryKeys(String tableName,
                                         Column[] columns,
                                         IColumnFilter columnFilter)
Deprecated. since 2.3.0 - use Columns.getColumns(String[], Column[])

Parameters:
tableName -
columns -
columnFilter -
Returns:
The filtered primary key columns

getColumnIndex

public int getColumnIndex(String columnName)
                   throws DataSetException
Provides the index of the column with the given name within this table. Uses method ITableMetaData.getColumns() to retrieve all available columns.

Specified by:
getColumnIndex in interface ITableMetaData
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:
DataSetException
NoSuchColumnException - if the given column has not been found
See Also:
ITableMetaData.getColumnIndex(java.lang.String)

getDataTypeFactory

public IDataTypeFactory getDataTypeFactory(IDatabaseConnection connection)
                                    throws SQLException
Validates and returns the datatype factory of the given connection

Parameters:
connection - The connection providing the IDataTypeFactory
Returns:
The datatype factory of the given connection
Throws:
SQLException


Copyright © 2002-2012. All Rights Reserved.