org.dbunit.dataset.datatype
Class DefaultDataTypeFactory

java.lang.Object
  extended by org.dbunit.dataset.datatype.DefaultDataTypeFactory
All Implemented Interfaces:
IDataTypeFactory
Direct Known Subclasses:
Db2DataTypeFactory, H2DataTypeFactory, HsqldbDataTypeFactory, MsSqlDataTypeFactory, MySqlDataTypeFactory, OracleDataTypeFactory

public class DefaultDataTypeFactory
extends Object
implements IDataTypeFactory

Generic factory that handle standard JDBC types.

Since:
May 17, 2003
Version:
$Revision: 824 $
Author:
Manuel Laflamme

Constructor Summary
DefaultDataTypeFactory()
           
 
Method Summary
 void addToleratedDelta(ToleratedDeltaMap.ToleratedDelta delta)
          Adds a tolerated delta to this data type factory to be used for numeric comparisons
 DataType createDataType(int sqlType, String sqlTypeName)
          Returns the DataType object that corresponds to the specified Types.
 DataType createDataType(int sqlType, String sqlTypeName, String tableName, String columnName)
          Returns the DataType object that corresponds to the specified Types and regards the given tableName and columnName.
 ToleratedDeltaMap getToleratedDeltaMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataTypeFactory

public DefaultDataTypeFactory()
Method Detail

createDataType

public DataType createDataType(int sqlType,
                               String sqlTypeName)
                        throws DataTypeException
Description copied from interface: IDataTypeFactory
Returns the DataType object that corresponds to the specified Types.

Specified by:
createDataType in interface IDataTypeFactory
Parameters:
sqlType - SQL type from Types
sqlTypeName - Data source dependent type name
Throws:
DataTypeException
See Also:
IDataTypeFactory.createDataType(int, java.lang.String)

createDataType

public DataType createDataType(int sqlType,
                               String sqlTypeName,
                               String tableName,
                               String columnName)
                        throws DataTypeException
Description copied from interface: IDataTypeFactory
Returns the DataType object that corresponds to the specified Types and regards the given tableName and columnName. When a ToleratedDeltaMap.ToleratedDelta has been set for a tableName.columnName set then this method automatically creates the correct datatype that honours the tolerance value in the assertion.

Specified by:
createDataType in interface IDataTypeFactory
Parameters:
sqlType - SQL type from Types
sqlTypeName - Data source dependent type name
tableName - The database table for which the type is created
columnName - The database column in the given table for which the type is created
Throws:
DataTypeException
See Also:
IDataTypeFactory.createDataType(int, java.lang.String, java.lang.String, java.lang.String)

getToleratedDeltaMap

public ToleratedDeltaMap getToleratedDeltaMap()
Returns:
The whole map of tolerated delta objects that have been set until now
Since:
2.3.0

addToleratedDelta

public void addToleratedDelta(ToleratedDeltaMap.ToleratedDelta delta)
Adds a tolerated delta to this data type factory to be used for numeric comparisons

Parameters:
delta - The new tolerated delta object
Since:
2.3.0


Copyright © 2002-2012. All Rights Reserved.