|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbunit.dataset.AbstractTableMetaData
org.dbunit.database.ResultSetTableMetaData
public class ResultSetTableMetaData
ResultSet
based ITableMetaData
implementation.
The lookup for the information needed to create the Column
objects is retrieved
in two phases:
ResultSet
via a DatabaseMetaData
object. Therefore the ResultSetMetaData
is used to get the catalog/schema/table/column
names which in turn are used to get column information via
DatabaseMetaData.getColumns(String, String, String, String)
. The reason for this is
that the DatabaseMetaData
is more precise and contains more information about columns
than the ResultSetMetaData
does. Another reason is that some JDBC drivers (currently known
from MYSQL driver) provide an inconsistent implementation of those two MetaData objects
and the DatabaseMetaData
is hence considered to be the master by dbunit.
ResultSetMetaData
instance the second
step will create the dbunit Column
using the ResultSetMetaData
methods
directly (for example ResultSetMetaData.getColumnType(int)
. (This is also the way
dbunit worked until the 2.4 release)
Constructor Summary | |
---|---|
ResultSetTableMetaData(String tableName,
ResultSet resultSet,
IDatabaseConnection connection,
boolean caseSensitiveMetaData)
|
|
ResultSetTableMetaData(String tableName,
ResultSet resultSet,
IDataTypeFactory dataTypeFactory,
boolean caseSensitiveMetaData)
Deprecated. since 2.4.4. use ResultSetTableMetaData(String, ResultSet, IDatabaseConnection, boolean) |
Method Summary | |
---|---|
Column[] |
getColumns()
Returns this table columns as recognized by dbunit. |
Column[] |
getPrimaryKeys()
Returns this table primary key columns. |
String |
getTableName()
Returns this table name. |
String |
toString()
|
Methods inherited from class org.dbunit.dataset.AbstractTableMetaData |
---|
getColumnIndex, getDataTypeFactory, getPrimaryKeys, getPrimaryKeys |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResultSetTableMetaData(String tableName, ResultSet resultSet, IDatabaseConnection connection, boolean caseSensitiveMetaData) throws DataSetException, SQLException
tableName
- The name of the database tableresultSet
- The JDBC result set that is used to retrieve the columnsconnection
- The connection which is needed to retrieve some configuration valuescaseSensitiveMetaData
- Whether or not the metadata is case sensitive
DataSetException
SQLException
public ResultSetTableMetaData(String tableName, ResultSet resultSet, IDataTypeFactory dataTypeFactory, boolean caseSensitiveMetaData) throws DataSetException, SQLException
ResultSetTableMetaData(String, ResultSet, IDatabaseConnection, boolean)
tableName
- The name of the database tableresultSet
- The JDBC result set that is used to retrieve the columnsdataTypeFactory
- caseSensitiveMetaData
- Whether or not the metadata is case sensitive
DataSetException
SQLException
Method Detail |
---|
public Column[] getColumns() throws DataSetException
ITableMetaData
IDataTypeFactory
.
Note that it is not an exceptional case within dbunit when a ITableMetaData
does not have a column.
DataSetException
public Column[] getPrimaryKeys() throws DataSetException
ITableMetaData
DataSetException
public String getTableName()
ITableMetaData
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |