Version 4.10.0

hirondelle.web4j.database
Class ConvertColumnImpl

Object
  extended by hirondelle.web4j.database.ConvertColumnImpl
All Implemented Interfaces:
ConvertColumn

public class ConvertColumnImpl
extends Object
implements ConvertColumn

Default implementation of ConvertColumn, suitable for most applications.

This class converts non-null items using :

Target ClassUse
SafeText ResultSet.getString(), or ResultSet.getClob()
String (if allowed) ResultSet.getString(), or ResultSet.getClob()
Integer ResultSet.getInt()
Long ResultSet.getLong()
Boolean ResultSet.getBoolean()
BigDecimal ResultSet.getBigDecimal()
Decimal ResultSet.getBigDecimal()
Id ResultSet.getString(), new Id(String)
DateTime ResultSet.getString(), pass to DateTime.DateTime(String)
Date ResultSet.getTimestamp(), possibly with hint provided in web.xml
Locale ResultSet.getString(), Util.buildLocale(String)
TimeZone ResultSet.getString(), Util.buildTimeZone(String)
InputStream ResultSet.getBinaryStream()

This implementation supports the same building block classes defined by another default implementation : ConvertParamImpl.isSupported(Class). See that class for important information on the conditional support of String.


Constructor Summary
ConvertColumnImpl()
           
 
Method Summary
<T> T
convert(ResultSet aRow, int aColumnIdx, Class<T> aSupportedTargetType)
          Defines policies for converting a column of a ResultSet into a possibly-null Object.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertColumnImpl

public ConvertColumnImpl()
Method Detail

convert

public <T> T convert(ResultSet aRow,
                     int aColumnIdx,
                     Class<T> aSupportedTargetType)
          throws SQLException
Defines policies for converting a column of a ResultSet into a possibly-null Object.

Specified by:
convert in interface ConvertColumn
Parameters:
aRow - of a ResultSet
aColumnIdx - particular column of aRow
aSupportedTargetType - is a class supported by the configured implementation of ConvertParam.isSupported(Class).
Throws:
SQLException

Version 4.10.0

Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.