org.dbunit.ext.postgresql
Class GenericEnumType

java.lang.Object
  extended by org.dbunit.dataset.datatype.DataType
      extended by org.dbunit.dataset.datatype.AbstractDataType
          extended by org.dbunit.ext.postgresql.GenericEnumType

public class GenericEnumType
extends AbstractDataType

Adapter to handle conversion between Postgresql native Enum type and Strings.

Since:
2.4.6
Version:
$Revision: 1025 $ $Date: 2009-08-16 23:29:16 +0200 (dom, 16 ago 2009) $
Author:
Jarvis Cochrane (jarvis@cochrane.com.au), gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Field Summary
 
Fields inherited from class org.dbunit.dataset.datatype.DataType
BIGINT, BIGINT_AUX_LONG, BINARY, BIT, BLOB, BOOLEAN, CHAR, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGNVARCHAR, LONGVARBINARY, LONGVARCHAR, NCHAR, NUMERIC, NVARCHAR, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, UNKNOWN, VARBINARY, VARCHAR
 
Constructor Summary
GenericEnumType(java.lang.String sqlTypeName)
           
 
Method Summary
 java.lang.String getSqlTypeName()
           
 java.lang.Object getSqlValue(int column, java.sql.ResultSet resultSet)
          Returns the specified column value from the specified resultset object.
 void setSqlValue(java.lang.Object enumObject, int column, java.sql.PreparedStatement statement)
          Set the specified value to the specified prepared statement object.
 java.lang.Object typeCast(java.lang.Object arg0)
          Returns the specified value typecasted to this DataType
 
Methods inherited from class org.dbunit.dataset.datatype.AbstractDataType
areObjectsEqual, compare, compareNonNulls, getSqlType, getTypeClass, isDateTime, isNumber, loadClass, loadClass, toString
 
Methods inherited from class org.dbunit.dataset.datatype.DataType
asString, forObject, forSqlType, forSqlTypeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericEnumType

public GenericEnumType(java.lang.String sqlTypeName)
Parameters:
sqlTypeName - The name of the enum type needed to invoke the "setType()" method on the PGObject class.
Method Detail

getSqlValue

public java.lang.Object getSqlValue(int column,
                                    java.sql.ResultSet resultSet)
                             throws java.sql.SQLException,
                                    TypeCastException
Description copied from class: DataType
Returns the specified column value from the specified resultset object.

Overrides:
getSqlValue in class AbstractDataType
Throws:
java.sql.SQLException
TypeCastException

setSqlValue

public void setSqlValue(java.lang.Object enumObject,
                        int column,
                        java.sql.PreparedStatement statement)
                 throws java.sql.SQLException,
                        TypeCastException
Description copied from class: DataType
Set the specified value to the specified prepared statement object.

Overrides:
setSqlValue in class AbstractDataType
Throws:
java.sql.SQLException
TypeCastException

typeCast

public java.lang.Object typeCast(java.lang.Object arg0)
                          throws TypeCastException
Description copied from class: DataType
Returns the specified value typecasted to this DataType

Specified by:
typeCast in class DataType
Throws:
TypeCastException

getSqlTypeName

public java.lang.String getSqlTypeName()


Copyright © 2002-2010. All Rights Reserved.