public interface Record extends FieldProvider, Store<Object>
SelectQuery
ResultQuery.getResult()
Modifier and Type | Method and Description |
---|---|
boolean |
changed()
Check if this record has been changed from its original as fetched from
the database.
|
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.
|
Object |
getValue(int index)
Get a value from this record, providing a field index.
|
<T> T |
getValue(int index,
Class<? extends T> type)
Get a converted value from this record, providing a field index.
|
<T> T |
getValue(int index,
Class<? extends T> type,
T defaultValue)
Get a converted value from this record, providing a field index.
|
<U> U |
getValue(int index,
Converter<?,U> converter)
Get a converted value from this record, providing a field index.
|
<U> U |
getValue(int index,
Converter<?,U> converter,
U defaultValue)
Get a converted value from this record, providing a field index.
|
Object |
getValue(int index,
Object defaultValue)
Get a value from this record, 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> |
getValueAsArray(Field<A> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse
|
<A extends ArrayRecord<T>,T> |
getValueAsArray(Field<A> field,
T[] defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse
|
BigDecimal |
getValueAsBigDecimal(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
BigDecimal |
getValueAsBigDecimal(Field<?> field,
BigDecimal defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
BigDecimal |
getValueAsBigDecimal(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
BigDecimal |
getValueAsBigDecimal(String fieldName,
BigDecimal defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
BigInteger |
getValueAsBigInteger(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
BigInteger |
getValueAsBigInteger(Field<?> field,
BigInteger defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
BigInteger |
getValueAsBigInteger(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
BigInteger |
getValueAsBigInteger(String fieldName,
BigInteger defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Boolean |
getValueAsBoolean(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Boolean |
getValueAsBoolean(Field<?> field,
Boolean defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Boolean |
getValueAsBoolean(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Boolean |
getValueAsBoolean(String fieldName,
Boolean defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Byte |
getValueAsByte(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Byte |
getValueAsByte(Field<?> field,
Byte defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Byte |
getValueAsByte(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Byte |
getValueAsByte(String fieldName,
Byte defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Date |
getValueAsDate(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Date |
getValueAsDate(Field<?> field,
Date defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Date |
getValueAsDate(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Date |
getValueAsDate(String fieldName,
Date defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Double |
getValueAsDouble(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Double |
getValueAsDouble(Field<?> field,
Double defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Double |
getValueAsDouble(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Double |
getValueAsDouble(String fieldName,
Double defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Float |
getValueAsFloat(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Float |
getValueAsFloat(Field<?> field,
Float defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Float |
getValueAsFloat(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Float |
getValueAsFloat(String fieldName,
Float defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Integer |
getValueAsInteger(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Integer |
getValueAsInteger(Field<?> field,
Integer defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Integer |
getValueAsInteger(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Integer |
getValueAsInteger(String fieldName,
Integer defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Long |
getValueAsLong(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Long |
getValueAsLong(Field<?> field,
Long defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Long |
getValueAsLong(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Long |
getValueAsLong(String fieldName,
Long defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Short |
getValueAsShort(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Short |
getValueAsShort(Field<?> field,
Short defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Short |
getValueAsShort(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Short |
getValueAsShort(String fieldName,
Short defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
String |
getValueAsString(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
String |
getValueAsString(Field<?> field,
String defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
String |
getValueAsString(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
String |
getValueAsString(String fieldName,
String defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Time |
getValueAsTime(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Time |
getValueAsTime(Field<?> field,
Time defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Time |
getValueAsTime(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Time |
getValueAsTime(String fieldName,
Time defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Timestamp |
getValueAsTimestamp(Field<?> field)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Timestamp |
getValueAsTimestamp(Field<?> field,
Timestamp defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(Field, Class)
instead. |
Timestamp |
getValueAsTimestamp(String fieldName)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
Timestamp |
getValueAsTimestamp(String fieldName,
Timestamp defaultValue)
Deprecated.
- 2.6.0 [#1839] - These methods will be removed in the
future. Do not reuse. Use
getValue(String, Class)
instead. |
<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> |
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.
|
<E> E |
map(RecordMapper<Record,E> mapper)
Map this record into a custom mapper callback
|
Record |
original()
Get this record containing the original values as fetched from the
database.
|
<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.
|
int |
size()
Get the number of fields of this record.
|
getField, getField, getField, getFields, getIndex
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
attach
internalAPI
<T> T getValue(Field<T> field) throws IllegalArgumentException
T
- The generic field parameterfield
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
<T> T getValue(Field<T> field, T defaultValue) throws IllegalArgumentException
T
- The generic field parameterfield
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
<T> T getValue(Field<?> field, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfield
- The fieldtype
- The conversion typeIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredDataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Class)
<T> T getValue(Field<?> field, Class<? extends T> type, T defaultValue) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfield
- The fieldtype
- The conversion typedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Class)
<T,U> U getValue(Field<T> field, Converter<? super T,U> converter) throws IllegalArgumentException, DataTypeException
T
- The database type parameterU
- The conversion type parameterfield
- The fieldconverter
- The data type converterIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Converter)
<T,U> U getValue(Field<T> field, Converter<? super T,U> converter, U defaultValue) throws IllegalArgumentException, DataTypeException
T
- The database type parameterU
- The conversion type parameterfield
- The fieldconverter
- The data type converterdefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Converter)
Object getValue(String fieldName) throws IllegalArgumentException
fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordObject getValue(String fieldName, Object defaultValue) throws IllegalArgumentException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record<T> T getValue(String fieldName, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfieldName
- The field's nametype
- The conversion typeIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Class)
<T> T getValue(String fieldName, Class<? extends T> type, T defaultValue) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfieldName
- The field's nametype
- The conversion typedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Class)
<U> U getValue(String fieldName, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
U
- The conversion type parameterfieldName
- The field's nameconverter
- The data type converterIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Converter)
<U> U getValue(String fieldName, Converter<?,U> converter, U defaultValue) throws IllegalArgumentException, DataTypeException
U
- The conversion type parameterfieldName
- The field's nameconverter
- The data type converterdefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Converter)
Object getValue(int index) throws IllegalArgumentException
getValue
in interface Store<Object>
index
- The field's indexIllegalArgumentException
- If the argument index is not contained
in the recordObject getValue(int index, Object defaultValue) throws IllegalArgumentException
getValue
in interface Store<Object>
index
- The field's indexdefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument index is not contained
in the record<T> T getValue(int index, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
getValue
in interface Store<Object>
T
- The conversion type parameterindex
- The field's indextype
- The conversion typeIllegalArgumentException
- If the argument index is not contained
in the recordDataTypeException
- wrapping data type conversion exception that
might have occurredConvert.convert(Object, Class)
<T> T getValue(int index, Class<? extends T> type, T defaultValue) throws IllegalArgumentException, DataTypeException
getValue
in interface Store<Object>
T
- The conversion type parameterindex
- The field's indextype
- The conversion typedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument index is not contained
in the recordDataTypeException
- wrapping data type conversion exception that
might have occurredConvert.convert(Object, Class)
<U> U getValue(int index, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
U
- The conversion type parameterindex
- The field's indexconverter
- The data type converterIllegalArgumentException
- If the argument index is not contained
in the recordDataTypeException
- wrapping data type conversion exception that
might have occurredConvert.convert(Object, Converter)
<U> U getValue(int index, Converter<?,U> converter, U defaultValue) throws IllegalArgumentException, DataTypeException
U
- The conversion type parameterindex
- The field's indexconverter
- The data type converterdefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument index is not contained
in the recordDataTypeException
- wrapping data type conversion exception that
might have occurredConvert.convert(Object, Converter)
@Deprecated <A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field) throws IllegalArgumentException
ArrayRecord
field.A
- The generic field parameterT
- The ArrayRecord
type parameterfield
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
@Deprecated <A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field, T[] defaultValue) throws IllegalArgumentException
ArrayRecord
field.A
- The generic field parameterT
- The ArrayRecord
type parameterfield
- The fielddefaultValue
- The default value instead of null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
@Deprecated String getValueAsString(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated String getValueAsString(Field<?> field, String defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated String getValueAsString(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated String getValueAsString(String fieldName, String defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Byte getValueAsByte(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Byte getValueAsByte(Field<?> field, Byte defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Byte getValueAsByte(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Byte getValueAsByte(String fieldName, Byte defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Short getValueAsShort(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Short getValueAsShort(Field<?> field, Short defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Short getValueAsShort(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Short getValueAsShort(String fieldName, Short defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Integer getValueAsInteger(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Integer getValueAsInteger(Field<?> field, Integer defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Integer getValueAsInteger(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Integer getValueAsInteger(String fieldName, Integer defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Long getValueAsLong(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Long getValueAsLong(Field<?> field, Long defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Long getValueAsLong(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Long getValueAsLong(String fieldName, Long defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigInteger getValueAsBigInteger(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigInteger getValueAsBigInteger(Field<?> field, BigInteger defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigInteger getValueAsBigInteger(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigInteger getValueAsBigInteger(String fieldName, BigInteger defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Float getValueAsFloat(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Float getValueAsFloat(Field<?> field, Float defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Float getValueAsFloat(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Float getValueAsFloat(String fieldName, Float defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Double getValueAsDouble(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Double getValueAsDouble(Field<?> field, Double defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Double getValueAsDouble(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Double getValueAsDouble(String fieldName, Double defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigDecimal getValueAsBigDecimal(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigDecimal getValueAsBigDecimal(Field<?> field, BigDecimal defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigDecimal getValueAsBigDecimal(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated BigDecimal getValueAsBigDecimal(String fieldName, BigDecimal defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Boolean getValueAsBoolean(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.
boolean values for true
are any of these case-insensitive
strings:
1
y
yes
true
on
enabled
boolean values for false
are any of these case-insensitive
strings:
0
n
no
false
off
disabled
All other values evaluate to null
field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Boolean getValueAsBoolean(Field<?> field, Boolean defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.
boolean values for true
are any of these case-insensitive
strings:
1
y
yes
true
on
enabled
boolean values for false
are any of these case-insensitive
strings:
0
n
no
false
off
disabled
All other values evaluate to null
field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Boolean getValueAsBoolean(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.
boolean values for true
are any of these case-insensitive
strings:
1
y
yes
true
on
enabled
boolean values for false
are any of these case-insensitive
strings:
0
n
no
false
off
disabled
All other values evaluate to null
fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Boolean getValueAsBoolean(String fieldName, Boolean defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.
boolean values for true
are any of these case-insensitive
strings:
1
y
yes
true
on
enabled
boolean values for false
are any of these case-insensitive
strings:
0
n
no
false
off
disabled
All other values evaluate to null
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Timestamp getValueAsTimestamp(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Timestamp getValueAsTimestamp(Field<?> field, Timestamp defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Timestamp getValueAsTimestamp(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Timestamp getValueAsTimestamp(String fieldName, Timestamp defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Date getValueAsDate(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Date getValueAsDate(Field<?> field, Date defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Date getValueAsDate(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Date getValueAsDate(String fieldName, Date defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Time getValueAsTime(Field<?> field) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fieldIllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Time getValueAsTime(Field<?> field, Time defaultValue) throws IllegalArgumentException, DataTypeException
getValue(Field, Class)
instead.field
- The fielddefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Time getValueAsTime(String fieldName) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's nameIllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred@Deprecated Time getValueAsTime(String fieldName, Time defaultValue) throws IllegalArgumentException, DataTypeException
getValue(String, Class)
instead.fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the recordDataTypeException
- wrapping any data type conversion exception
that might have occurred<T> void setValue(Field<T> field, T value)
T
- The generic field parameterfield
- The fieldvalue
- The value<T,U> void setValue(Field<T> field, U value, Converter<T,? super U> converter)
T
- The generic field parameterU
- The conversion type parameterfield
- The fieldvalue
- The valueconverter
- The converter used to convert value
into an
appropriate typeint size()
Record original()
Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns a new record containing those original values.
boolean changed()
If this returns false
, then it can be said that
record.equals(record.original())
is true.
original()
Object[] intoArray()
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)
Map<String,Object> intoMap()
<E> E into(Class<? extends E> type) throws MappingException
The mapping algorithm is this:
type
is an array:intoArray()
. Arrays more specific than
Object[]
can be specified as well, e.g.
String[]
. If conversion fails, a MappingException
is
thrown, wrapping conversion exceptions.
Column
annotations are found on the provided type
, only those are
used:type
contains public single-argument instance methods
annotated with Column
, those methods are invokedtype
contains public no-argument instance methods
starting with getXXX
or isXXX
, annotated with
Column
, then matching public setXXX()
instance
methods are invokedtype
contains public instance member fields annotated
with Column
, those members are setColumn.name()
must match Field.getName()
. All other
annotation attributes are ignoredColumn
annotations, or jOOQ can't find the
javax.persistence
API on the classpath, jOOQ will map
Record
values by naming convention:Field.getName()
is MY_field
(case-sensitive!), then
this field's value will be set on all of these:
MY_field(...)
myField(...)
setMY_field(...)
setMyField(...)
MY_field
myField
ConstructorProperties
is available, that one
is usedConstructorProperties
annotation is
used to match constructor arguments against POJO members or getters.Record
values onto constructor arguments.Record
values onto constructor arguments.Class.getDeclaredConstructors()
Class.getDeclaredConstructors()
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)
.
type
must provide a default or a "matching" constructor.
Non-public default constructors are made accessible using
AccessibleObject.setAccessible(boolean)
null
, this
will result in setting the primitive type's default value (zero for
numbers, or false
for booleans). Hence, there is no way of
distinguishing null
and 0
in that case.E
- The generic entity type.type
- The entity type.MappingException
- wrapping any reflection exception that might
have occurred while mapping recordsfrom(Object)
<E> E into(E object) throws MappingException
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.
E
- The generic entity type.object
- The receiving bean.MappingException
- wrapping any reflection exception that might
have occurred while mapping recordsNullPointerException
- if object
is null
from(Object)
<R extends Record> R into(Table<R> table)
The mapping algorithm is this:
Record
values by equal field names:table
argument with
Field.getName()
"MY_field"
(case-sensitive!), a
corresponding field with the same name in this record will be searched.Field.getName()
, then the first one returning true on
Field.equals(Object)
will be returned. (e.g. qualified field
names match)Table.getRecordType()
must return a class of type
TableRecord
, which must provide a default constructor. Non-public
default constructors are made accessible using
AccessibleObject.setAccessible(boolean)
R
- The generic table record type.table
- The table type.<E> E map(RecordMapper<Record,E> mapper)
mapper
- The mapper callbackvoid from(Object source) throws MappingException
Column
annotations are found on the Class
of the provided source
, only those are used. Matching
candidates are:Column
getXXX
or isXXX
, if there exists a matching public single-argument
setXXX()
instance method that is annotated with
Column
Column
Column.name()
must match Field.getName()
. All other
annotation attributes are ignoredColumn
annotations, or jOOQ can't
find the javax.persistence
API on the classpath, jOOQ will
map members by naming convention:Field.getName()
is
MY_field
(case-sensitive!), then this field's value will be
fetched from the first of these:
MY_field()
myField()
getMY_field()
getMyField()
MY_field
myField
UpdatableRecord.store()
will perform an INSERT
statement. If you wish to store the record using an UPDATE
statement, use Factory.executeUpdate(UpdatableRecord)
instead.source
- The source object to copy data fromMappingException
- wrapping any reflection exception that might
have occurred while mapping recordsinto(Class)
Copyright © 2013. All Rights Reserved.