|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jooq.impl.TableRecordImpl<R>
org.jooq.impl.CustomRecord<R>
public abstract class CustomRecord<R extends TableRecord<R>>
A base class for custom 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:
Constructor Summary | |
---|---|
protected |
CustomRecord(Table<R> table)
|
Method Summary | ||
---|---|---|
void |
attach(Configuration configuration)
Attach this object to a new Configuration |
|
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 |
|
|
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 |
|
|
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. |
|
Object |
getValue(int index)
Get a value from this Store, providing a field index. |
|
|
getValue(int index,
Class<? extends Z> type)
Get a converted value from this Store, providing a field index. |
|
|
getValue(int index,
Class<? extends Z> type,
Z defaultValue)
Get a converted value from this Store, providing a field index. |
|
|
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. |
|
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. |
|
|
getValue(String fieldName,
Class<? extends T> type)
Get a converted value from this Record, providing a field name. |
|
|
getValue(String fieldName,
Class<? extends Z> type,
Z 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(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()
|
|
|
internalAPI(Class<I> internalType)
Adapt to an internal type assuming its functionality This is for JOOQ INTERNAL USE only. |
|
|
into(Class<? extends T> type)
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. |
|
|
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. |
|
int |
size()
Get the size of this Store . |
|
String |
toString()
|
Methods inherited from class org.jooq.impl.TableRecordImpl |
---|
deleteUsing, refreshUsing, storeUsing |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Constructor Detail |
---|
protected CustomRecord(Table<R> table)
Method Detail |
---|
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 fetch
public final Field<?> getField(String name)
FieldProvider
getField
in interface FieldProvider
name
- The field to fetch
public final Field<?> getField(int index)
FieldProvider
getField
in interface FieldProvider
index
- The field's index of the field to fetch
public final int size()
Store
Store
.
If this is an ArrayRecord
, then the array size is returned. If
this is a Record
, then the number of fields is returned.
It can be said that getValue(size() - 1)
will return a
value, if size > 0
size
in interface Store<Object>
public final int getIndex(Field<?> field)
FieldProvider
getIndex
in interface FieldProvider
field
- The field to look for
public final <T> T getValue(Field<T> field)
Record
getValue
in interface Record
T
- The generic field parameterfield
- The field
public final <T> T getValue(Field<T> field, T defaultValue)
Record
getValue
in interface Record
T
- The generic field parameterfield
- The fielddefaultValue
- The default value instead of null
null
public final <T> void setValue(Field<T> field, T value)
Record
setValue
in interface Record
T
- The generic field parameterfield
- The fieldvalue
- The valuepublic final <T,U> void setValue(Field<T> field, U value, Converter<T,? super U> converter)
Record
setValue
in interface Record
T
- The generic field parameterU
- The conversion type parameterfield
- The fieldvalue
- The valueconverter
- The converter used to convert value
into an
appropriate typepublic String toString()
toString
in class Object
public final String getValueAsString(Field<?> field)
Record
getValueAsString
in interface Record
field
- The field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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 field
public 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)
Store
getValue
in interface Store<Object>
index
- The field's index
public final Object getValue(String fieldName)
Record
getValue
in interface Record
fieldName
- The field's name
public final Object getValue(String fieldName, Object defaultValue)
Record
getValue
in interface Record
fieldName
- The field's namedefaultValue
- The default value instead of null
null
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 field
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 name
public 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 type
Convert.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 type
Convert.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 converter
Convert.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 converter
Convert.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 converter
Convert.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 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)
intoArray
in interface Record
public final <T> T into(Class<? extends T> type)
Record
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
type
must provide a default 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
T
- The generic entity type.type
- The entity type.Record.from(Object)
public final <R extends Record> R into(Table<R> table)
Record
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. Type.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)
into
in interface Record
R
- The generic table record type.table
- The table type.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
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 type
public final void attach(Configuration configuration)
Attachable
Configuration
attach
in interface Attachable
public final Configuration getConfiguration()
AttachableInternal
getConfiguration
in interface AttachableInternal
protected final Factory create()
public final T getValue(int index, T defaultValue)
Store
getValue
in interface Store<T>
index
- The field's indexdefaultValue
- The default value instead of null
null
public final BigDecimal getValueAsBigDecimal(int index)
Store
getValueAsBigDecimal
in interface Store<T>
index
- The field's index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 index
public 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 type
Convert.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)
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |