Package no.digipost.jdbc
Class Mappers
- java.lang.Object
-
- no.digipost.jdbc.Mappers
-
public final class Mappers extends Object
Various predefined mappers used to extract result(s) from aResultSet
.- See Also:
ColumnMapper
,RowMapper
-
-
Field Summary
-
-
-
Field Detail
-
getBoolean
public static final BasicColumnMapper<Boolean> getBoolean
Gets the value of a given column as a Javaboolean
. Unlike theResultSet.getBoolean(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedBoolean
. However, for nullable columns, thegetNullableBoolean
mapper should be preferred over this.- See Also:
ResultSet.getBoolean(String)
-
getNullableBoolean
public static final NullableColumnMapper<Boolean> getNullableBoolean
- See Also:
ResultSet.getBoolean(String)
-
getByte
public static final BasicColumnMapper<Byte> getByte
Gets the value of a given column as a Javabyte
. Unlike theResultSet.getByte(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedByte
. However, for nullable columns, thegetNullableByte
mapper should be preferred over this.- See Also:
ResultSet.getByte(String)
-
getNullableByte
public static final NullableColumnMapper<Byte> getNullableByte
- See Also:
ResultSet.getByte(String)
-
getShort
public static final BasicColumnMapper<Short> getShort
Gets the value of a given column as a Javashort
. Unlike theResultSet.getShort(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedShort
. However, for nullable columns, thegetNullableShort
mapper should be preferred over this.- See Also:
ResultSet.getShort(String)
-
getNullableShort
public static final NullableColumnMapper<Short> getNullableShort
- See Also:
ResultSet.getShort(String)
-
getInt
public static final BasicColumnMapper<Integer> getInt
Gets the value of a given column as a Javaint
. Unlike theResultSet.getInt(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedInteger
. However, for nullable columns, thegetNullableInt
mapper should be preferred over this.- See Also:
ResultSet.getInt(String)
-
getNullableInt
public static final NullableColumnMapper<Integer> getNullableInt
- See Also:
ResultSet.getInt(String)
-
getLong
public static final BasicColumnMapper<Long> getLong
Gets the value of a given column as a Javalong
. Unlike theResultSet.getLong(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedLong
. However, for nullable columns, thegetNullableLong
mapper should be preferred over this.- See Also:
ResultSet.getLong(String)
-
getNullableLong
public static final NullableColumnMapper<Long> getNullableLong
- See Also:
ResultSet.getLong(String)
-
getFloat
public static final BasicColumnMapper<Float> getFloat
Gets the value of a given column as a Javafloat
. Unlike theResultSet.getFloat(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedFloat
. However, for nullable columns, thegetNullableFloat
mapper should be preferred over this.- See Also:
ResultSet.getFloat(String)
-
getNullableFloat
public static final NullableColumnMapper<Float> getNullableFloat
- See Also:
ResultSet.getFloat(String)
-
getDouble
public static final BasicColumnMapper<Double> getDouble
Gets the value of a given column as a Javadouble
. Unlike theResultSet.getDouble(String)
, this mapper yieldsnull
for SQLNULL
, as the returned value is a boxedDouble
. However, for nullable columns, thegetNullableDouble
mapper should be preferred over this.- See Also:
ResultSet.getDouble(String)
-
getNullableDouble
public static final NullableColumnMapper<Double> getNullableDouble
- See Also:
ResultSet.getDouble(String)
-
getBigDecimal
public static final BasicColumnMapper<BigDecimal> getBigDecimal
- See Also:
ResultSet.getBigDecimal(String)
-
getNullableBigDecimal
public static final NullableColumnMapper<BigDecimal> getNullableBigDecimal
- See Also:
ResultSet.getBigDecimal(String)
-
getBytes
public static final BasicColumnMapper<byte[]> getBytes
- See Also:
ResultSet.getBytes(String)
-
getNullableBytes
public static final NullableColumnMapper<byte[]> getNullableBytes
- See Also:
ResultSet.getBytes(String)
-
getString
public static final BasicColumnMapper<String> getString
- See Also:
ResultSet.getString(String)
-
getNullableString
public static final NullableColumnMapper<String> getNullableString
- See Also:
ResultSet.getString(String)
-
getURL
public static final BasicColumnMapper<URL> getURL
- See Also:
ResultSet.getURL(String)
-
getNullableURL
public static final NullableColumnMapper<URL> getNullableURL
- See Also:
ResultSet.getURL(String)
-
getDate
public static final BasicColumnMapper<Date> getDate
- See Also:
ResultSet.getDate(String)
-
getNullableDate
public static final NullableColumnMapper<Date> getNullableDate
- See Also:
ResultSet.getDate(String)
-
getTimestamp
public static final BasicColumnMapper<Timestamp> getTimestamp
- See Also:
ResultSet.getTimestamp(String)
-
getNullableTimestamp
public static final NullableColumnMapper<Timestamp> getNullableTimestamp
- See Also:
ResultSet.getTimestamp(String)
-
getInstant
public static final BasicColumnMapper<Instant> getInstant
-
getNullableInstant
public static final NullableColumnMapper<Instant> getNullableInstant
-
getAsciiStream
public static final BasicColumnMapper<InputStream> getAsciiStream
- See Also:
ResultSet.getAsciiStream(String)
-
getNullableAsciiStream
public static final NullableColumnMapper<InputStream> getNullableAsciiStream
- See Also:
ResultSet.getAsciiStream(String)
-
getBinaryStream
public static final BasicColumnMapper<InputStream> getBinaryStream
- See Also:
ResultSet.getBinaryStream(String)
-
getNullableBinaryStream
public static final NullableColumnMapper<InputStream> getNullableBinaryStream
- See Also:
ResultSet.getBinaryStream(String)
-
getCharacterStream
public static final BasicColumnMapper<Reader> getCharacterStream
- See Also:
ResultSet.getCharacterStream(String)
-
getNullableCharacterStream
public static final NullableColumnMapper<Reader> getNullableCharacterStream
- See Also:
ResultSet.getCharacterStream(String)
-
getSqlArray
public static final BasicColumnMapper<Array> getSqlArray
- See Also:
ResultSet.getArray(String)
-
getArray
public static final BasicColumnMapper<Object> getArray
Gets the value of a given SQLARRAY
column as an uncasted Java array object. The result should be casted to the applicable specific array type.- See Also:
getStringArray
,getIntArray
,getLongArray
-
getStringArray
public static final BasicColumnMapper<String[]> getStringArray
Gets the value of a given SQLARRAY
column as anString[]
array.
-
getIntArray
public static final BasicColumnMapper<int[]> getIntArray
Gets the value of a given SQLARRAY
column as anint[]
array.
-
getLongArray
public static final BasicColumnMapper<long[]> getLongArray
Gets the value of a given SQLARRAY
column as anlong[]
array.
-
-