public abstract class CustomRecord<R extends TableRecord<R>> extends TableRecordImpl<R>
TableRecord
implementations in client code.
Client code may provide proper TableRecord
implementations extending
this useful base class. All necessary parts of the TableRecord
interface are already implemented. No methods need further implementation.
Use this base class when providing custom tables to any of the following methods:
Modifier | Constructor and Description |
---|---|
protected |
CustomRecord(Table<R> table) |
Modifier and Type | Method and Description |
---|---|
void |
attach(Configuration c)
Attach this object to a new
Configuration |
boolean |
changed()
Check if this record has been changed from its original as fetched from
the database.
|
protected Factory |
create()
This method is used in generated code!
|
boolean |
equals(Object obj) |
void |
from(Object source)
Load data into this record from a source.
|
protected void |
from(Record source)
This method was implemented with [#799].
|
List<Attachable> |
getAttachables()
Get the list of dependent
Attachables
This method is for JOOQ INTERNAL USE only. |
Configuration |
getConfiguration()
Get the underlying configuration
|
<T> Field<T> |
getField(Field<T> field)
Get a specific field from this field provider.
|
Field<?> |
getField(int index)
Get a specific field from this field provider.
|
Field<?> |
getField(String name)
Get a specific field from this field provider.
|
List<Field<?>> |
getFields() |
int |
getIndex(Field<?> field)
Get a fields index from this field provider
|
Table<R> |
getTable()
The table from which this record was read
|
<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.
|
<Z> Z |
getValue(int index,
Class<? extends Z> type)
Get a converted value from this Store, providing a field index.
|
<Z> Z |
getValue(int index,
Class<? extends Z> type,
Z defaultValue)
Get a converted value from this Store, 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.
|
T |
getValue(int index,
T defaultValue)
Get a 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.
|
<Z> Z |
getValue(String fieldName,
Class<? extends Z> type,
Z 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)
Get an array value from this Record, providing an
ArrayRecord
field. |
<A extends ArrayRecord<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(int index)
Get a value from this Store, providing a field index.
|
BigDecimal |
getValueAsBigDecimal(int index,
BigDecimal defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
BigInteger |
getValueAsBigInteger(int index,
BigInteger defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Boolean |
getValueAsBoolean(int index,
Boolean defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Byte |
getValueAsByte(int index,
Byte defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Date |
getValueAsDate(int index,
Date defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Double |
getValueAsDouble(int index,
Double defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Float |
getValueAsFloat(int index,
Float defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Integer |
getValueAsInteger(int index,
Integer defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Long |
getValueAsLong(int index,
Long defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Short |
getValueAsShort(int index,
Short defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
String |
getValueAsString(int index,
String defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Time |
getValueAsTime(int index,
Time defaultValue)
Get a value from this Store, providing a field index.
|
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(int index)
Get a value from this Store, providing a field index.
|
Timestamp |
getValueAsTimestamp(int index,
Timestamp defaultValue)
Get a value from this Store, providing a field index.
|
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.
|
int |
hashCode() |
<I> I |
internalAPI(Class<I> internalType)
Adapt to an internal type assuming its functionality
This is for JOOQ INTERNAL USE only.
|
<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
|
<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.
|
String |
toString() |
deleteUsing, original, refreshUsing, storeUsing
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
changed, from, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueAsArray, getValueAsArray, getValueAsBigDecimal, getValueAsBigDecimal, getValueAsBigDecimal, getValueAsBigDecimal, getValueAsBigInteger, getValueAsBigInteger, getValueAsBigInteger, getValueAsBigInteger, getValueAsBoolean, getValueAsBoolean, getValueAsBoolean, getValueAsBoolean, getValueAsByte, getValueAsByte, getValueAsByte, getValueAsByte, getValueAsDate, getValueAsDate, getValueAsDate, getValueAsDate, getValueAsDouble, getValueAsDouble, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, getValueAsLong, getValueAsLong, getValueAsShort, getValueAsShort, getValueAsShort, getValueAsShort, getValueAsString, getValueAsString, getValueAsString, getValueAsString, getValueAsTime, getValueAsTime, getValueAsTime, getValueAsTime, getValueAsTimestamp, getValueAsTimestamp, getValueAsTimestamp, getValueAsTimestamp, into, into, into, intoArray, intoMap, map, setValue, setValue, size
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
public final Table<R> getTable()
TableRecord
getTable
in interface TableRecord<R extends TableRecord<R>>
getTable
in class TableRecordImpl<R extends TableRecord<R>>
public final List<Attachable> getAttachables()
AttachableInternal
Attachables
This method is for JOOQ INTERNAL USE only. Do not reference directly
getAttachables
in interface AttachableInternal
public final List<Field<?>> getFields()
getFields
in interface FieldProvider
public final <T> Field<T> getField(Field<T> field)
FieldProvider
Usually, this will return the field itself. However, if this is an aliased table, the field will be aliased accordingly.
getField
in interface FieldProvider
T
- The generic field typefield
- The field to fetchpublic final Field<?> getField(String name)
FieldProvider
getField
in interface FieldProvider
name
- The field to fetchpublic final Field<?> getField(int index)
FieldProvider
getField
in interface FieldProvider
index
- The field's index of the field to fetchpublic final int size()
Record
public final int getIndex(Field<?> field)
FieldProvider
getIndex
in interface FieldProvider
field
- The field to look forpublic final <T> T getValue(Field<T> field)
Record
public final <T> T getValue(Field<T> field, T defaultValue)
Record
public final <T> void setValue(Field<T> field, T value)
Record
public final <T,U> void setValue(Field<T> field, U value, Converter<T,? super U> converter)
Record
public final String getValueAsString(Field<?> field)
Record
getValueAsString
in interface Record
field
- The fieldpublic final String getValueAsString(Field<?> field, String defaultValue)
Record
getValueAsString
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Byte getValueAsByte(Field<?> field)
Record
getValueAsByte
in interface Record
field
- The fieldpublic final Byte getValueAsByte(Field<?> field, Byte defaultValue)
Record
getValueAsByte
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Short getValueAsShort(Field<?> field)
Record
getValueAsShort
in interface Record
field
- The fieldpublic final Short getValueAsShort(Field<?> field, Short defaultValue)
Record
getValueAsShort
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Integer getValueAsInteger(Field<?> field)
Record
getValueAsInteger
in interface Record
field
- The fieldpublic final Integer getValueAsInteger(Field<?> field, Integer defaultValue)
Record
getValueAsInteger
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Long getValueAsLong(Field<?> field)
Record
getValueAsLong
in interface Record
field
- The fieldpublic final Long getValueAsLong(Field<?> field, Long defaultValue)
Record
getValueAsLong
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final BigInteger getValueAsBigInteger(Field<?> field)
Record
getValueAsBigInteger
in interface Record
field
- The fieldpublic final BigInteger getValueAsBigInteger(Field<?> field, BigInteger defaultValue)
Record
getValueAsBigInteger
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Float getValueAsFloat(Field<?> field)
Record
getValueAsFloat
in interface Record
field
- The fieldpublic final Float getValueAsFloat(Field<?> field, Float defaultValue)
Record
getValueAsFloat
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Double getValueAsDouble(Field<?> field)
Record
getValueAsDouble
in interface Record
field
- The fieldpublic final Double getValueAsDouble(Field<?> field, Double defaultValue)
Record
getValueAsDouble
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final BigDecimal getValueAsBigDecimal(Field<?> field)
Record
getValueAsBigDecimal
in interface Record
field
- The fieldpublic final BigDecimal getValueAsBigDecimal(Field<?> field, BigDecimal defaultValue)
Record
getValueAsBigDecimal
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Boolean getValueAsBoolean(Field<?> field)
Record
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
getValueAsBoolean
in interface Record
field
- The fieldpublic final Boolean getValueAsBoolean(Field<?> field, Boolean defaultValue)
Record
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
getValueAsBoolean
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Timestamp getValueAsTimestamp(Field<?> field)
Record
getValueAsTimestamp
in interface Record
field
- The fieldpublic final Timestamp getValueAsTimestamp(Field<?> field, Timestamp defaultValue)
Record
getValueAsTimestamp
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Date getValueAsDate(Field<?> field)
Record
getValueAsDate
in interface Record
field
- The fieldpublic final Date getValueAsDate(Field<?> field, Date defaultValue)
Record
getValueAsDate
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Time getValueAsTime(Field<?> field)
Record
getValueAsTime
in interface Record
field
- The fieldpublic final Time getValueAsTime(Field<?> field, Time defaultValue)
Record
getValueAsTime
in interface Record
field
- The fielddefaultValue
- The default value instead of null
null
public final Object getValue(int index)
Record
public final Object getValue(String fieldName)
Record
public final Object getValue(String fieldName, Object defaultValue)
Record
public final <A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field)
Record
ArrayRecord
field.getValueAsArray
in interface Record
A
- The generic field parameterT
- The ArrayRecord
type parameterfield
- The fieldpublic final <A extends ArrayRecord<T>,T> T[] getValueAsArray(Field<A> field, T[] defaultValue)
Record
ArrayRecord
field.getValueAsArray
in interface Record
A
- The generic field parameterT
- The ArrayRecord
type parameterfield
- The fielddefaultValue
- The default value instead of null
public final String getValueAsString(String fieldName)
Record
getValueAsString
in interface Record
fieldName
- The field's namepublic final String getValueAsString(String fieldName, String defaultValue)
Record
getValueAsString
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Byte getValueAsByte(String fieldName)
Record
getValueAsByte
in interface Record
fieldName
- The field's namepublic final Byte getValueAsByte(String fieldName, Byte defaultValue)
Record
getValueAsByte
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Short getValueAsShort(String fieldName)
Record
getValueAsShort
in interface Record
fieldName
- The field's namepublic final Short getValueAsShort(String fieldName, Short defaultValue)
Record
getValueAsShort
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Integer getValueAsInteger(String fieldName)
Record
getValueAsInteger
in interface Record
fieldName
- The field's namepublic final Integer getValueAsInteger(String fieldName, Integer defaultValue)
Record
getValueAsInteger
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Long getValueAsLong(String fieldName)
Record
getValueAsLong
in interface Record
fieldName
- The field's namepublic final Long getValueAsLong(String fieldName, Long defaultValue)
Record
getValueAsLong
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final BigInteger getValueAsBigInteger(String fieldName)
Record
getValueAsBigInteger
in interface Record
fieldName
- The field's namepublic final BigInteger getValueAsBigInteger(String fieldName, BigInteger defaultValue)
Record
getValueAsBigInteger
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Float getValueAsFloat(String fieldName)
Record
getValueAsFloat
in interface Record
fieldName
- The field's namepublic final Float getValueAsFloat(String fieldName, Float defaultValue)
Record
getValueAsFloat
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Double getValueAsDouble(String fieldName)
Record
getValueAsDouble
in interface Record
fieldName
- The field's namepublic final Double getValueAsDouble(String fieldName, Double defaultValue)
Record
getValueAsDouble
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final BigDecimal getValueAsBigDecimal(String fieldName)
Record
getValueAsBigDecimal
in interface Record
fieldName
- The field's namepublic final BigDecimal getValueAsBigDecimal(String fieldName, BigDecimal defaultValue)
Record
getValueAsBigDecimal
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Boolean getValueAsBoolean(String fieldName)
Record
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
getValueAsBoolean
in interface Record
fieldName
- The field's namepublic final Boolean getValueAsBoolean(String fieldName, Boolean defaultValue)
Record
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
getValueAsBoolean
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Timestamp getValueAsTimestamp(String fieldName)
Record
getValueAsTimestamp
in interface Record
fieldName
- The field's namepublic final Timestamp getValueAsTimestamp(String fieldName, Timestamp defaultValue)
Record
getValueAsTimestamp
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Date getValueAsDate(String fieldName)
Record
getValueAsDate
in interface Record
fieldName
- The field's namepublic final Date getValueAsDate(String fieldName, Date defaultValue)
Record
getValueAsDate
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final Time getValueAsTime(String fieldName)
Record
getValueAsTime
in interface Record
fieldName
- The field's namepublic final Time getValueAsTime(String fieldName, Time defaultValue)
Record
getValueAsTime
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
public final <T> T getValue(Field<?> field, Class<? extends T> type)
Record
getValue
in interface Record
T
- The conversion type parameterfield
- The fieldtype
- The conversion typeConvert.convert(Object, Class)
public final <T> T getValue(Field<?> field, Class<? extends T> type, T defaultValue)
Record
getValue
in interface Record
T
- The conversion type parameterfield
- The fieldtype
- The conversion typedefaultValue
- The default value instead of null
null
Convert.convert(Object, Class)
public final <T> T getValue(String fieldName, Class<? extends T> type)
Record
getValue
in interface Record
T
- The conversion type parameterfieldName
- The field's nametype
- The conversion typeConvert.convert(Object, Class)
public final <Z> Z getValue(String fieldName, Class<? extends Z> type, Z defaultValue)
Record
getValue
in interface Record
Z
- The conversion type parameterfieldName
- The field's nametype
- The conversion typedefaultValue
- The default value instead of null
null
Convert.convert(Object, Class)
public final <T,U> U getValue(Field<T> field, Converter<? super T,U> converter)
Record
getValue
in interface Record
T
- The database type parameterU
- The conversion type parameterfield
- The fieldconverter
- The data type converterConvert.convert(Object, Converter)
public final <T,U> U getValue(Field<T> field, Converter<? super T,U> converter, U defaultValue)
Record
getValue
in interface Record
T
- The database type parameterU
- The conversion type parameterfield
- The fieldconverter
- The data type converterdefaultValue
- The default value instead of null
null
Convert.convert(Object, Converter)
public final <U> U getValue(int index, Converter<?,U> converter)
Record
getValue
in interface Record
U
- The conversion type parameterindex
- The field's indexconverter
- The data type converterConvert.convert(Object, Converter)
public final <U> U getValue(int index, Converter<?,U> converter, U defaultValue)
Record
getValue
in interface Record
U
- The conversion type parameterindex
- The field's indexconverter
- The data type converterdefaultValue
- The default value instead of null
null
Convert.convert(Object, Converter)
public final <U> U getValue(String fieldName, Converter<?,U> converter)
Record
getValue
in interface Record
U
- The conversion type parameterfieldName
- The field's nameconverter
- The data type converterConvert.convert(Object, Converter)
public final <U> U getValue(String fieldName, Converter<?,U> converter, U defaultValue)
Record
getValue
in interface Record
U
- The conversion type parameterfieldName
- The field's nameconverter
- The data type converterdefaultValue
- The default value instead of null
null
Convert.convert(Object, Converter)
public final boolean changed()
Record
If this returns false
, then it can be said that
record.equals(record.original())
is true.
changed
in interface Record
Record.original()
public final Object[] intoArray()
Record
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)
public final Map<String,Object> intoMap()
Record
public final <E> E into(Class<? extends E> type)
Record
The mapping algorithm is this:
type
is an array:Record.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.into
in interface Record
E
- The generic entity type.type
- The entity type.Record.from(Object)
public final <E> E into(E object)
Record
This is the same as Record.into(Class)
, except that no new object is
instanciated as a result. Instead, you can provide your own custom POJO
instance.
into
in interface Record
E
- The generic entity type.object
- The receiving bean.Record.from(Object)
public final <R extends Record> R into(Table<R> table)
Record
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)
public final <E> E map(RecordMapper<Record,E> mapper)
Record
public final void from(Object source)
Record
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.from
in interface Record
source
- The source object to copy data fromRecord.into(Class)
protected final void from(Record source)
public final <I> I internalAPI(Class<I> internalType)
Adapter
This is for JOOQ INTERNAL USE only. If you need to access the internal API, these are the known possible interfaces:
QueryPartInternal
: The internal API for QueryPart
internalAPI
in interface Adapter
I
- The internal type's generic type parameter.internalType
- The internal typepublic final void attach(Configuration c)
Attachable
Configuration
attach
in interface Attachable
c
- A configuration or null
, if you wish to
detach this Attachable
from its previous
configuration.public final Configuration getConfiguration()
AttachableInternal
getConfiguration
in interface AttachableInternal
protected final Factory create()
public final T getValue(int index, T defaultValue)
Store
public final BigDecimal getValueAsBigDecimal(int index)
Store
getValueAsBigDecimal
in interface Store<T>
index
- The field's indexpublic final BigDecimal getValueAsBigDecimal(int index, BigDecimal defaultValue)
Store
getValueAsBigDecimal
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Boolean getValueAsBoolean(int index)
Store
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
getValueAsBoolean
in interface Store<T>
index
- The field's indexpublic final Boolean getValueAsBoolean(int index, Boolean defaultValue)
Store
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
getValueAsBoolean
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final BigInteger getValueAsBigInteger(int index)
Store
getValueAsBigInteger
in interface Store<T>
index
- The field's indexpublic final BigInteger getValueAsBigInteger(int index, BigInteger defaultValue)
Store
getValueAsBigInteger
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Byte getValueAsByte(int index)
Store
getValueAsByte
in interface Store<T>
index
- The field's indexpublic final Byte getValueAsByte(int index, Byte defaultValue)
Store
getValueAsByte
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Date getValueAsDate(int index)
Store
getValueAsDate
in interface Store<T>
index
- The field's indexpublic final Date getValueAsDate(int index, Date defaultValue)
Store
getValueAsDate
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Double getValueAsDouble(int index)
Store
getValueAsDouble
in interface Store<T>
index
- The field's indexpublic final Double getValueAsDouble(int index, Double defaultValue)
Store
getValueAsDouble
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Float getValueAsFloat(int index)
Store
getValueAsFloat
in interface Store<T>
index
- The field's indexpublic final Float getValueAsFloat(int index, Float defaultValue)
Store
getValueAsFloat
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Integer getValueAsInteger(int index)
Store
getValueAsInteger
in interface Store<T>
index
- The field's indexpublic final Integer getValueAsInteger(int index, Integer defaultValue)
Store
getValueAsInteger
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Long getValueAsLong(int index)
Store
getValueAsLong
in interface Store<T>
index
- The field's indexpublic final Long getValueAsLong(int index, Long defaultValue)
Store
getValueAsLong
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Short getValueAsShort(int index)
Store
getValueAsShort
in interface Store<T>
index
- The field's indexpublic final Short getValueAsShort(int index, Short defaultValue)
Store
getValueAsShort
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final String getValueAsString(int index)
Store
getValueAsString
in interface Store<T>
index
- The field's indexpublic final String getValueAsString(int index, String defaultValue)
Store
getValueAsString
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Time getValueAsTime(int index)
Store
getValueAsTime
in interface Store<T>
index
- The field's indexpublic final Time getValueAsTime(int index, Time defaultValue)
Store
getValueAsTime
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final Timestamp getValueAsTimestamp(int index)
Store
getValueAsTimestamp
in interface Store<T>
index
- The field's indexpublic final Timestamp getValueAsTimestamp(int index, Timestamp defaultValue)
Store
getValueAsTimestamp
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final <Z> Z getValue(int index, Class<? extends Z> type)
Store
getValue
in interface Store<T>
Z
- The conversion type parameterindex
- The field's indextype
- The conversion typeConvert.convert(Object, Class)
public final <Z> Z getValue(int index, Class<? extends Z> type, Z defaultValue)
Store
getValue
in interface Store<T>
Z
- The conversion type parameterindex
- The field's indextype
- The conversion typedefaultValue
- The default value instead of null
null
Convert.convert(Object, Class)
Copyright © 2013. All Rights Reserved.