org.dbunit.ext.postgresql
Class PostgresqlDataTypeFactory

java.lang.Object
  extended by org.dbunit.dataset.datatype.DefaultDataTypeFactory
      extended by org.dbunit.ext.postgresql.PostgresqlDataTypeFactory
All Implemented Interfaces:
IDataTypeFactory, IDbProductRelatable

public class PostgresqlDataTypeFactory
extends DefaultDataTypeFactory

Specialized factory that recognizes Postgresql data types.

Derived from work by manuel.laflamme

Since:
2.4.5 (Apr 27, 2009)
Author:
Jarvis Cochrane (jarvis@cochrane.com.au), manuel.laflamme

Constructor Summary
PostgresqlDataTypeFactory()
           
 
Method Summary
 DataType createDataType(int sqlType, String sqlTypeName)
          Returns the DataType object that corresponds to the specified Types.
 Collection getValidDbProducts()
          Returns a set of Strings representing database product names that this object relates to.
 boolean isEnumType(String sqlTypeName)
          Returns a data type for the given sql type name if the user wishes one.
 
Methods inherited from class org.dbunit.dataset.datatype.DefaultDataTypeFactory
addToleratedDelta, createDataType, getToleratedDeltaMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PostgresqlDataTypeFactory

public PostgresqlDataTypeFactory()
Method Detail

getValidDbProducts

public Collection getValidDbProducts()
Description copied from interface: IDbProductRelatable
Returns a set of Strings representing database product names that this object relates to.

Specified by:
getValidDbProducts in interface IDbProductRelatable
Overrides:
getValidDbProducts in class DefaultDataTypeFactory
Returns:
Set of Strings.
See Also:
IDbProductRelatable.getValidDbProducts()

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
Overrides:
createDataType in class DefaultDataTypeFactory
Parameters:
sqlType - SQL type from Types
sqlTypeName - Data source dependent type name
Throws:
DataTypeException
See Also:
IDataTypeFactory.createDataType(int, java.lang.String)

isEnumType

public boolean isEnumType(String sqlTypeName)
Returns a data type for the given sql type name if the user wishes one. Designed to be overridden by custom implementations extending this class. Override this method if you have a custom enum type in the database and want to map it via dbunit.

Parameters:
sqlTypeName - The sql type name for which users can specify a custom data type.
Returns:
null if the given type name is not a custom type which is the default implementation.
Since:
2.4.6


Copyright © 2002-2012. All Rights Reserved.