org.jooq
Interface Record

All Superinterfaces:
Adapter, Attachable, FieldProvider, Serializable, Store<Object>
All Known Subinterfaces:
TableRecord<R>, UDTRecord<R>, UpdatableRecord<R>
All Known Implementing Classes:
CustomRecord, TableRecordImpl, UDTRecordImpl, UpdatableRecordImpl

public interface Record
extends FieldProvider, Store<Object>

A wrapper for database result records returned by SelectQuery

Author:
Lukas Eder
See Also:
ResultQuery.getResult()

Method Summary
 void from(Object source)
          Load data into this record from a source.
<T> T
getValue(Field<?> field, Class<? extends T> type)
          Get a converted value from this Record, providing a field.
<T> T
getValue(Field<?> field, Class<? extends T> type, T defaultValue)
          Get a converted value from this record, providing a field.
<T> T
getValue(Field<T> field)
          Get a value from this Record, providing a field.
<T,U> U
getValue(Field<T> field, Converter<? super T,U> converter)
          Get a converted value from this Record, providing a field.
<T,U> U
getValue(Field<T> field, Converter<? super T,U> converter, U defaultValue)
          Get a converted value from this record, providing a field.
<T> T
getValue(Field<T> field, T defaultValue)
          Get a value from this record, providing a field.
<U> U
getValue(int index, Converter<?,U> converter)
          Get a converted value from this Store, providing a field index.
<U> U
getValue(int index, Converter<?,U> converter, U defaultValue)
          Get a converted value from this Store, providing a field index.
 Object getValue(String fieldName)
          Get a value from this Record, providing a field name.
<T> T
getValue(String fieldName, Class<? extends T> type)
          Get a converted value from this Record, providing a field name.
<T> T
getValue(String fieldName, Class<? extends T> type, T defaultValue)
          Get a converted value from this record, providing a field name.
<U> U
getValue(String fieldName, Converter<?,U> converter)
          Get a converted value from this Record, providing a field name.
<U> U
getValue(String fieldName, Converter<?,U> converter, U defaultValue)
          Get a converted value from this record, providing a field name.
 Object getValue(String fieldName, Object defaultValue)
          Get a value from this record, providing a field name.
<A extends ArrayRecord<T>,T>
T[]
getValueAsArray(Field<A> field)
          Get an array value from this Record, providing an ArrayRecord field.
<A extends ArrayRecord<T>,T>
T[]
getValueAsArray(Field<A> field, T[] defaultValue)
          Get an array value from this Record, providing an ArrayRecord field.
 BigDecimal getValueAsBigDecimal(Field<?> field)
          Get a value from this Record, providing a field.
 BigDecimal getValueAsBigDecimal(Field<?> field, BigDecimal defaultValue)
          Get a value from this record, providing a field.
 BigDecimal getValueAsBigDecimal(String fieldName)
          Get a value from this Record, providing a field name.
 BigDecimal getValueAsBigDecimal(String fieldName, BigDecimal defaultValue)
          Get a value from this record, providing a field name.
 BigInteger getValueAsBigInteger(Field<?> field)
          Get a value from this Record, providing a field.
 BigInteger getValueAsBigInteger(Field<?> field, BigInteger defaultValue)
          Get a value from this record, providing a field.
 BigInteger getValueAsBigInteger(String fieldName)
          Get a value from this Record, providing a field name.
 BigInteger getValueAsBigInteger(String fieldName, BigInteger defaultValue)
          Get a value from this record, providing a field name.
 Boolean getValueAsBoolean(Field<?> field)
          Get a value from this Record, providing a field.
 Boolean getValueAsBoolean(Field<?> field, Boolean defaultValue)
          Get a value from this record, providing a field.
 Boolean getValueAsBoolean(String fieldName)
          Get a value from this Record, providing a field name.
 Boolean getValueAsBoolean(String fieldName, Boolean defaultValue)
          Get a value from this record, providing a field name.
 Byte getValueAsByte(Field<?> field)
          Get a value from this Record, providing a field.
 Byte getValueAsByte(Field<?> field, Byte defaultValue)
          Get a value from this record, providing a field.
 Byte getValueAsByte(String fieldName)
          Get a value from this Record, providing a field name.
 Byte getValueAsByte(String fieldName, Byte defaultValue)
          Get a value from this record, providing a field name.
 Date getValueAsDate(Field<?> field)
          Get a value from this Record, providing a field.
 Date getValueAsDate(Field<?> field, Date defaultValue)
          Get a value from this record, providing a field.
 Date getValueAsDate(String fieldName)
          Get a value from this Record, providing a field name.
 Date getValueAsDate(String fieldName, Date defaultValue)
          Get a value from this record, providing a field name.
 Double getValueAsDouble(Field<?> field)
          Get a value from this Record, providing a field.
 Double getValueAsDouble(Field<?> field, Double defaultValue)
          Get a value from this record, providing a field.
 Double getValueAsDouble(String fieldName)
          Get a value from this Record, providing a field name.
 Double getValueAsDouble(String fieldName, Double defaultValue)
          Get a value from this record, providing a field name.
 Float getValueAsFloat(Field<?> field)
          Get a value from this Record, providing a field.
 Float getValueAsFloat(Field<?> field, Float defaultValue)
          Get a value from this record, providing a field.
 Float getValueAsFloat(String fieldName)
          Get a value from this Record, providing a field name.
 Float getValueAsFloat(String fieldName, Float defaultValue)
          Get a value from this record, providing a field name.
 Integer getValueAsInteger(Field<?> field)
          Get a value from this Record, providing a field.
 Integer getValueAsInteger(Field<?> field, Integer defaultValue)
          Get a value from this record, providing a field.
 Integer getValueAsInteger(String fieldName)
          Get a value from this Record, providing a field name.
 Integer getValueAsInteger(String fieldName, Integer defaultValue)
          Get a value from this record, providing a field name.
 Long getValueAsLong(Field<?> field)
          Get a value from this Record, providing a field.
 Long getValueAsLong(Field<?> field, Long defaultValue)
          Get a value from this record, providing a field.
 Long getValueAsLong(String fieldName)
          Get a value from this Record, providing a field name.
 Long getValueAsLong(String fieldName, Long defaultValue)
          Get a value from this record, providing a field name.
 Short getValueAsShort(Field<?> field)
          Get a value from this Record, providing a field.
 Short getValueAsShort(Field<?> field, Short defaultValue)
          Get a value from this record, providing a field.
 Short getValueAsShort(String fieldName)
          Get a value from this Record, providing a field name.
 Short getValueAsShort(String fieldName, Short defaultValue)
          Get a value from this record, providing a field name.
 String getValueAsString(Field<?> field)
          Get a value from this Record, providing a field.
 String getValueAsString(Field<?> field, String defaultValue)
          Get a value from this record, providing a field.
 String getValueAsString(String fieldName)
          Get a value from this Record, providing a field name.
 String getValueAsString(String fieldName, String defaultValue)
          Get a value from this record, providing a field name.
 Time getValueAsTime(Field<?> field)
          Get a value from this Record, providing a field.
 Time getValueAsTime(Field<?> field, Time defaultValue)
          Get a value from this record, providing a field.
 Time getValueAsTime(String fieldName)
          Get a value from this Record, providing a field name.
 Time getValueAsTime(String fieldName, Time defaultValue)
          Get a value from this record, providing a field name.
 Timestamp getValueAsTimestamp(Field<?> field)
          Get a value from this Record, providing a field.
 Timestamp getValueAsTimestamp(Field<?> field, Timestamp defaultValue)
          Get a value from this record, providing a field.
 Timestamp getValueAsTimestamp(String fieldName)
          Get a value from this Record, providing a field name.
 Timestamp getValueAsTimestamp(String fieldName, Timestamp defaultValue)
          Get a value from this record, providing a field name.
<E> E
into(Class<? extends E> type)
          Map resulting records onto a custom type.
<E> E
into(E object)
          Map resulting records onto a custom type.
<R extends Record>
R
into(Table<R> table)
          Map resulting records onto a custom record type.
 Object[] intoArray()
          Convert this record into an array.
 Map<String,Object> intoMap()
          Return this record as a name/value map.
<T> void
setValue(Field<T> field, T value)
          Set a value into this record.
<T,U> void
setValue(Field<T> field, U value, Converter<T,? super U> converter)
          Set a value into this record.
 
Methods inherited from interface org.jooq.FieldProvider
getField, getField, getField, getFields, getIndex
 
Methods inherited from interface org.jooq.Store
getValue, getValue, getValue, getValue, getValueAsBigDecimal, getValueAsBigDecimal, getValueAsBigInteger, getValueAsBigInteger, getValueAsBoolean, getValueAsBoolean, getValueAsByte, getValueAsByte, getValueAsDate, getValueAsDate, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, getValueAsShort, getValueAsShort, getValueAsString, getValueAsString, getValueAsTime, getValueAsTime, getValueAsTimestamp, getValueAsTimestamp, size
 
Methods inherited from interface org.jooq.Attachable
attach
 
Methods inherited from interface org.jooq.Adapter
internalAPI
 

Method Detail

getValue

<T> T getValue(Field<T> field)
           throws IllegalArgumentException
Get a value from this Record, providing a field.

Type Parameters:
T - The generic field parameter
Parameters:
field - The field
Returns:
The value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()

getValue

<T> T getValue(Field<T> field,
               T defaultValue)
           throws IllegalArgumentException
Get a value from this record, providing a field.

Type Parameters:
T - The generic field parameter
Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()

getValueAsArray

<A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field)
                    throws IllegalArgumentException
Get an array value from this Record, providing an ArrayRecord field.

Type Parameters:
A - The generic field parameter
T - The ArrayRecord type parameter
Parameters:
field - The field
Returns:
The value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()

getValueAsArray

<A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field,
                                                 T[] defaultValue)
                    throws IllegalArgumentException
Get an array value from this Record, providing an ArrayRecord field.

Type Parameters:
A - The generic field parameter
T - The ArrayRecord type parameter
Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()

getValue

Object getValue(String fieldName)
                throws IllegalArgumentException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The value of a field's name contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record

getValue

Object getValue(String fieldName,
                Object defaultValue)
                throws IllegalArgumentException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record

getValueAsString

String getValueAsString(Field<?> field)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsString

String getValueAsString(Field<?> field,
                        String defaultValue)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsString

String getValueAsString(String fieldName)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsString

String getValueAsString(String fieldName,
                        String defaultValue)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsByte

Byte getValueAsByte(Field<?> field)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsByte

Byte getValueAsByte(Field<?> field,
                    Byte defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsByte

Byte getValueAsByte(String fieldName)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsByte

Byte getValueAsByte(String fieldName,
                    Byte defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsShort

Short getValueAsShort(Field<?> field)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsShort

Short getValueAsShort(Field<?> field,
                      Short defaultValue)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsShort

Short getValueAsShort(String fieldName)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsShort

Short getValueAsShort(String fieldName,
                      Short defaultValue)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsInteger

Integer getValueAsInteger(Field<?> field)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsInteger

Integer getValueAsInteger(Field<?> field,
                          Integer defaultValue)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsInteger

Integer getValueAsInteger(String fieldName)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsInteger

Integer getValueAsInteger(String fieldName,
                          Integer defaultValue)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsLong

Long getValueAsLong(Field<?> field)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsLong

Long getValueAsLong(Field<?> field,
                    Long defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsLong

Long getValueAsLong(String fieldName)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsLong

Long getValueAsLong(String fieldName,
                    Long defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigInteger

BigInteger getValueAsBigInteger(Field<?> field)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigInteger

BigInteger getValueAsBigInteger(Field<?> field,
                                BigInteger defaultValue)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigInteger

BigInteger getValueAsBigInteger(String fieldName)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigInteger

BigInteger getValueAsBigInteger(String fieldName,
                                BigInteger defaultValue)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsFloat

Float getValueAsFloat(Field<?> field)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsFloat

Float getValueAsFloat(Field<?> field,
                      Float defaultValue)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsFloat

Float getValueAsFloat(String fieldName)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsFloat

Float getValueAsFloat(String fieldName,
                      Float defaultValue)
                      throws IllegalArgumentException,
                             DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDouble

Double getValueAsDouble(Field<?> field)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDouble

Double getValueAsDouble(Field<?> field,
                        Double defaultValue)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDouble

Double getValueAsDouble(String fieldName)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDouble

Double getValueAsDouble(String fieldName,
                        Double defaultValue)
                        throws IllegalArgumentException,
                               DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigDecimal

BigDecimal getValueAsBigDecimal(Field<?> field)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigDecimal

BigDecimal getValueAsBigDecimal(Field<?> field,
                                BigDecimal defaultValue)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigDecimal

BigDecimal getValueAsBigDecimal(String fieldName)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBigDecimal

BigDecimal getValueAsBigDecimal(String fieldName,
                                BigDecimal defaultValue)
                                throws IllegalArgumentException,
                                       DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBoolean

Boolean getValueAsBoolean(Field<?> field)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this Record, providing a field.

boolean values for true are any of these case-insensitive strings:

boolean values for false are any of these case-insensitive strings:

All other values evaluate to null

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBoolean

Boolean getValueAsBoolean(Field<?> field,
                          Boolean defaultValue)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this record, providing a field.

boolean values for true are any of these case-insensitive strings:

boolean values for false are any of these case-insensitive strings:

All other values evaluate to null

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBoolean

Boolean getValueAsBoolean(String fieldName)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this Record, providing a field name.

boolean values for true are any of these case-insensitive strings:

boolean values for false are any of these case-insensitive strings:

All other values evaluate to null

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsBoolean

Boolean getValueAsBoolean(String fieldName,
                          Boolean defaultValue)
                          throws IllegalArgumentException,
                                 DataTypeException
Get a value from this record, providing a field name.

boolean values for true are any of these case-insensitive strings:

boolean values for false are any of these case-insensitive strings:

All other values evaluate to null

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTimestamp

Timestamp getValueAsTimestamp(Field<?> field)
                              throws IllegalArgumentException,
                                     DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTimestamp

Timestamp getValueAsTimestamp(Field<?> field,
                              Timestamp defaultValue)
                              throws IllegalArgumentException,
                                     DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTimestamp

Timestamp getValueAsTimestamp(String fieldName)
                              throws IllegalArgumentException,
                                     DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTimestamp

Timestamp getValueAsTimestamp(String fieldName,
                              Timestamp defaultValue)
                              throws IllegalArgumentException,
                                     DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDate

Date getValueAsDate(Field<?> field)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDate

Date getValueAsDate(Field<?> field,
                    Date defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDate

Date getValueAsDate(String fieldName)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsDate

Date getValueAsDate(String fieldName,
                    Date defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTime

Time getValueAsTime(Field<?> field)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field.

Parameters:
field - The field
Returns:
The converted value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTime

Time getValueAsTime(Field<?> field,
                    Time defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field.

Parameters:
field - The field
defaultValue - The default value instead of null
Returns:
The converted value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTime

Time getValueAsTime(String fieldName)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this Record, providing a field name.

Parameters:
fieldName - The field's name
Returns:
The converted value of a field's index contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValueAsTime

Time getValueAsTime(String fieldName,
                    Time defaultValue)
                    throws IllegalArgumentException,
                           DataTypeException
Get a value from this record, providing a field name.

Parameters:
fieldName - The field's name
defaultValue - The default value instead of null
Returns:
The converted value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred

getValue

<T> T getValue(Field<?> field,
               Class<? extends T> type)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Record, providing a field.

Type Parameters:
T - The conversion type parameter
Parameters:
field - The field
type - The conversion type
Returns:
The value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Class)

getValue

<T> T getValue(Field<?> field,
               Class<? extends T> type,
               T defaultValue)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this record, providing a field.

Type Parameters:
T - The conversion type parameter
Parameters:
field - The field
type - The conversion type
defaultValue - The default value instead of null
Returns:
The value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Class)

getValue

<T,U> U getValue(Field<T> field,
                 Converter<? super T,U> converter)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Record, providing a field.

Type Parameters:
T - The database type parameter
U - The conversion type parameter
Parameters:
field - The field
converter - The data type converter
Returns:
The value of a field contained in this record
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

getValue

<T,U> U getValue(Field<T> field,
                 Converter<? super T,U> converter,
                 U defaultValue)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this record, providing a field.

Type Parameters:
T - The database type parameter
U - The conversion type parameter
Parameters:
field - The field
converter - The data type converter
defaultValue - The default value instead of null
Returns:
The value of a field contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument field is not contained in FieldProvider.getFields()
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

getValue

<T> T getValue(String fieldName,
               Class<? extends T> type)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Record, providing a field name.

Type Parameters:
T - The conversion type parameter
Parameters:
fieldName - The field's name
type - The conversion type
Returns:
The value of a field's name contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Class)

getValue

<T> T getValue(String fieldName,
               Class<? extends T> type,
               T defaultValue)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this record, providing a field name.

Type Parameters:
T - The conversion type parameter
Parameters:
fieldName - The field's name
type - The conversion type
defaultValue - The default value instead of null
Returns:
The value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Class)

getValue

<U> U getValue(int index,
               Converter<?,U> converter)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Store, providing a field index.

Type Parameters:
U - The conversion type parameter
Parameters:
index - The field's index
converter - The data type converter
Returns:
The value of a field's index contained in this Store
Throws:
IllegalArgumentException - If the argument index is not contained in the Store
DataTypeException - wrapping data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

getValue

<U> U getValue(int index,
               Converter<?,U> converter,
               U defaultValue)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Store, providing a field index.

Type Parameters:
U - The conversion type parameter
Parameters:
index - The field's index
converter - The data type converter
defaultValue - The default value instead of null
Returns:
The value of a field's index contained in this Store, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument index is not contained in the Store
DataTypeException - wrapping data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

getValue

<U> U getValue(String fieldName,
               Converter<?,U> converter)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this Record, providing a field name.

Type Parameters:
U - The conversion type parameter
Parameters:
fieldName - The field's name
converter - The data type converter
Returns:
The value of a field's name contained in this record
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

getValue

<U> U getValue(String fieldName,
               Converter<?,U> converter,
               U defaultValue)
           throws IllegalArgumentException,
                  DataTypeException
Get a converted value from this record, providing a field name.

Type Parameters:
U - The conversion type parameter
Parameters:
fieldName - The field's name
converter - The data type converter
defaultValue - The default value instead of null
Returns:
The value of a field's name contained in this record, or defaultValue, if null
Throws:
IllegalArgumentException - If the argument fieldName is not contained in the record
DataTypeException - wrapping any data type conversion exception that might have occurred
See Also:
Convert.convert(Object, Converter)

setValue

<T> void setValue(Field<T> field,
                  T value)
Set a value into this record.

Type Parameters:
T - The generic field parameter
Parameters:
field - The field
value - The value

setValue

<T,U> void setValue(Field<T> field,
                    U value,
                    Converter<T,? super U> converter)
Set a value into this record.

Type Parameters:
T - The generic field parameter
U - The conversion type parameter
Parameters:
field - The field
value - The value
converter - The converter used to convert value into an appropriate type

intoArray

Object[] intoArray()
Convert this record into an array.

The resulting array has the same number of elements as this record has fields. The resulting array contains data as such:

 // For arbitrary values of i
 record.getValue(i) == record.intoArray()[i]
 

This is the same as calling into(Object[].class)

Returns:
This record as an array

intoMap

Map<String,Object> intoMap()
Return this record as a name/value map.

Returns:
This record as a map

into

<E> E into(Class<? extends E> type)
       throws MappingException
Map resulting records onto a custom type.

The mapping algorithm is this:

If type is an array:

The resulting array is of the nature described in intoArray(). Arrays more specific than Object[] can be specified as well, e.g. String[]. If conversion fails, a MappingException is thrown, wrapping conversion exceptions.

If a default constructor is available and any JPA Column annotations are found on the provided type, only those are used:

Additional rules:

If a default constructor is available and if there are no JPA Column annotations, or jOOQ can't find the javax.persistence API on the classpath, jOOQ will map Record values by naming convention:

If Field.getName() is MY_field (case-sensitive!), then this field's value will be set on all of these:

If no default constructor is available, but at least one "matching" constructor is available, that one is used

If the supplied type is an interface or an abstract class

Abstract types are instanciated using Java reflection Proxy mechanisms. The returned proxy will wrap a HashMap containing properties mapped by getters and setters of the supplied type. Methods (even JPA-annotated ones) other than standard POJO getters and setters are not supported. Details can be seen in Reflect.as(Class).

Other restrictions

Type Parameters:
E - The generic entity type.
Parameters:
type - The entity type.
Throws:
MappingException - wrapping any reflection exception that might have occurred while mapping records
See Also:
from(Object)

into

<E> E into(E object)
       throws MappingException
Map resulting records onto a custom type.

This is the same as into(Class), except that no new object is instanciated as a result. Instead, you can provide your own custom POJO instance.

Type Parameters:
E - The generic entity type.
Parameters:
type - The entity type.
Throws:
MappingException - wrapping any reflection exception that might have occurred while mapping records
NullPointerException - if object is null
See Also:
from(Object)

into

<R extends Record> R into(Table<R> table)
Map resulting records onto a custom record type. The mapping algorithm is this:

jOOQ will map Record values by equal field names:

If a field's value for Field.getName() is MY_field (case-sensitive!), then there must be a field in table with the exact same name.

Other restrictions

Type Parameters:
R - The generic table record type.
Parameters:
table - The table type.

from

void from(Object source)
          throws MappingException
Load data into this record from a source. The mapping algorithm is this:

If any JPA Column annotations are found on the Class of the provided source, only those are used. Matching candidates are:

Additional matching rules:

If there are no JPA Column annotations, or jOOQ can't find the javax.persistence API on the classpath, jOOQ will map members by naming convention:

If Field.getName() is MY_field (case-sensitive!), then this field's value will be fetched from the first of these:

Other restrictions

General notes

The resulting record will have its internal "changed" flags set to true for all values. This means that UpdatableRecord.store() will perform an INSERT statement. If you wish to store the record using an UPDATE statement, use Factory.executeUpdate(UpdatableRecord) instead.

Parameters:
source - The source object to copy data from
Throws:
MappingException - wrapping any reflection exception that might have occurred while mapping records
See Also:
into(Class)


Copyright © 2012. All Rights Reserved.