|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Record
A wrapper for database result records returned by
SelectQuery
ResultQuery.getResult()
Method Summary | ||
---|---|---|
void |
from(Object source)
Load data into this record from a source. |
|
|
getValue(Field<?> field,
Class<? extends T> type)
Get a converted value from this Record, providing a field. |
|
|
getValue(Field<?> field,
Class<? extends T> type,
T defaultValue)
Get a converted value from this record, providing a field. |
|
|
getValue(Field<T> field)
Get a value from this Record, providing a field. |
|
|
getValue(Field<T> field,
Converter<? super T,U> converter)
Get a converted value from this Record, providing a field. |
|
|
getValue(Field<T> field,
Converter<? super T,U> converter,
U defaultValue)
Get a converted value from this record, providing a field. |
|
|
getValue(Field<T> field,
T defaultValue)
Get a value from this record, providing a field. |
|
|
getValue(int index,
Converter<?,U> converter)
Get a converted value from this Store, providing a field index. |
|
|
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. |
|
|
getValue(String fieldName,
Class<? extends T> type)
Get a converted value from this Record, providing a field name. |
|
|
getValue(String fieldName,
Class<? extends T> type,
T defaultValue)
Get a converted value from this record, providing a field name. |
|
|
getValue(String fieldName,
Converter<?,U> converter)
Get a converted value from this Record, providing a field name. |
|
|
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. |
|
|
getValueAsArray(Field<A> field)
Get an array value from this Record, providing an ArrayRecord
field. |
|
|
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. |
|
|
into(Class<? extends E> type)
Map resulting records onto a custom type. |
|
|
into(E object)
Map resulting records onto a custom type. |
|
|
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. |
|
|
setValue(Field<T> field,
T value)
Set a value into this record. |
|
|
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.Attachable |
---|
attach |
Methods inherited from interface org.jooq.Adapter |
---|
internalAPI |
Method Detail |
---|
<T> T getValue(Field<T> field) throws IllegalArgumentException
T
- The generic field parameterfield
- The field
IllegalArgumentException
- 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()
<A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field) throws IllegalArgumentException
ArrayRecord
field.
A
- The generic field parameterT
- The ArrayRecord
type parameterfield
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
<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()
Object getValue(String fieldName) throws IllegalArgumentException
fieldName
- The field's name
IllegalArgumentException
- 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 recordString getValueAsString(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredString getValueAsString(Field<?> field, String defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredString getValueAsString(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredString getValueAsString(String fieldName, String defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredByte getValueAsByte(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredByte getValueAsByte(Field<?> field, Byte defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredByte getValueAsByte(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredByte getValueAsByte(String fieldName, Byte defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredShort getValueAsShort(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredShort getValueAsShort(Field<?> field, Short defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredShort getValueAsShort(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredShort getValueAsShort(String fieldName, Short defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredInteger getValueAsInteger(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredInteger getValueAsInteger(Field<?> field, Integer defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredInteger getValueAsInteger(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredInteger getValueAsInteger(String fieldName, Integer defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredLong getValueAsLong(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredLong getValueAsLong(Field<?> field, Long defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredLong getValueAsLong(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredLong getValueAsLong(String fieldName, Long defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigInteger getValueAsBigInteger(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigInteger getValueAsBigInteger(Field<?> field, BigInteger defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredBigInteger getValueAsBigInteger(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigInteger getValueAsBigInteger(String fieldName, BigInteger defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredFloat getValueAsFloat(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredFloat getValueAsFloat(Field<?> field, Float defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredFloat getValueAsFloat(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredFloat getValueAsFloat(String fieldName, Float defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredDouble getValueAsDouble(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredDouble getValueAsDouble(Field<?> field, Double defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredDouble getValueAsDouble(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredDouble getValueAsDouble(String fieldName, Double defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigDecimal getValueAsBigDecimal(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigDecimal getValueAsBigDecimal(Field<?> field, BigDecimal defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredBigDecimal getValueAsBigDecimal(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBigDecimal getValueAsBigDecimal(String fieldName, BigDecimal defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBoolean getValueAsBoolean(Field<?> field) throws IllegalArgumentException, DataTypeException
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 field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredBoolean getValueAsBoolean(Field<?> field, Boolean defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredBoolean getValueAsBoolean(String fieldName) throws IllegalArgumentException, DataTypeException
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 name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredBoolean getValueAsBoolean(String fieldName, Boolean defaultValue) throws IllegalArgumentException, DataTypeException
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 record
DataTypeException
- wrapping any data type conversion exception
that might have occurredTimestamp getValueAsTimestamp(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredTimestamp getValueAsTimestamp(Field<?> field, Timestamp defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredTimestamp getValueAsTimestamp(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredTimestamp getValueAsTimestamp(String fieldName, Timestamp defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredDate getValueAsDate(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredDate getValueAsDate(Field<?> field, Date defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredDate getValueAsDate(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredDate getValueAsDate(String fieldName, Date defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredTime getValueAsTime(Field<?> field) throws IllegalArgumentException, DataTypeException
field
- The field
IllegalArgumentException
- If the argument field is not contained
in FieldProvider.getFields()
DataTypeException
- wrapping any data type conversion exception
that might have occurredTime getValueAsTime(Field<?> field, Time defaultValue) throws IllegalArgumentException, DataTypeException
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 occurredTime getValueAsTime(String fieldName) throws IllegalArgumentException, DataTypeException
fieldName
- The field's name
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurredTime getValueAsTime(String fieldName, Time defaultValue) throws IllegalArgumentException, DataTypeException
fieldName
- The field's namedefaultValue
- The default value instead of null
null
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- wrapping any data type conversion exception
that might have occurred<T> T getValue(Field<?> field, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfield
- The fieldtype
- The conversion type
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 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 converter
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)
<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)
<T> T getValue(String fieldName, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
T
- The conversion type parameterfieldName
- The field's nametype
- The conversion type
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- 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 record
DataTypeException
- wrapping any 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 converter
IllegalArgumentException
- If the argument index is not contained
in the Store
DataTypeException
- 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 Store
DataTypeException
- wrapping data type conversion exception that
might have occurredConvert.convert(Object, Converter)
<U> U getValue(String fieldName, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
U
- The conversion type parameterfieldName
- The field's nameconverter
- The data type converter
IllegalArgumentException
- If the argument fieldName is not
contained in the record
DataTypeException
- 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 record
DataTypeException
- wrapping any data type conversion exception
that might have occurredConvert.convert(Object, Converter)
<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 typeObject[] 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
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.type
- The entity type.
MappingException
- wrapping any reflection exception that might
have occurred while mapping records
NullPointerException
- if object
is null
from(Object)
<R extends Record> R into(Table<R> table)
Record
values by equal field names:Field.getName()
is MY_field
(case-sensitive!), then there must be a field in table
with
the exact same name. 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.void 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 from
MappingException
- wrapping any reflection exception that might
have occurred while mapping recordsinto(Class)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |