A record essentially combines a list of columns (Field) with a
corresponding list of values, each value being of the respective field's
type.
While records can be seen as generic column / value mappings, their concrete implementations often specialise the above description in any of the following ways:
Records originating from a concrete database table (or view) are modelled by
jOOQ as TableRecord or UpdatableRecord, if they contain a
primary key. If you're using jOOQ's code generator, you can generate even
more concrete types of table records, i.e. one table record per table.
SQLDialect#ORACLE and SQLDialect#POSTGRES formally support
user defined types (UDT), which are modelled by jOOQ as UDTRecord. In
addition to being regular records (column / value mappings), they also
implement the JDBC SQLData API in order to be streamed to a JDBC
PreparedStatement or from a JDBC ResultSet
When projecting custom record types in SQL, new ad-hoc types of a certain
degree are formed on the fly. Records with degree <= 22 are reflected by
jOOQ through the Record1, Record2, ... Record22
classes, which cover the respective row value expressions Row1,
Row2, ... Row22
Note that generated TableRecords and UDTRecords
also implement a Record[N] interface, if N <= 22
jOOQ records have a natural ordering implemented in the same way as this is
defined in the SQL standard. For more details, see the
compareTo(Record) method.
Starting from Java 14, the Record type conflicts with
java., which is always imported by default. According to
Java Language Specification, this means that jOOQ's Record type
can no longer be imported on demand. This is not sufficient:
import org.jooq.*;
You have to do this instead:
import org.jooq.*;
import org.jooq.Record;
Result
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | changed(Field<?> field)
Deprecated
as a consequence of
Check if a field's value has been changed from its original as fetched
from the database, using Field being deprecated.
field(Field) for lookup.
|
| public boolean | changed(int
The 0-based field index in this record. fieldIndex)Check if a field's value has been changed from its original as fetched from the database. |
| public boolean | changed(String fieldName)
Check if a field's value has been changed from its original as fetched
from the database, using |
| public boolean | changed(Name fieldName)
Check if a field's value has been changed from its original as fetched
from the database, using |
| public void | |
| public void | changed(Field<?> field, boolean changed)
Deprecated
as a consequence of
Set this record's internal changed flag to the supplied value for a given
field, using Field being deprecated.
field(Field) for lookup.
|
| public void | changed(int
The 0-based field index in this record. fieldIndex, boolean changed)Set this record's internal changed flag to the supplied value for a given field. |
| public void | changed(String fieldName, boolean changed)
Set this record's internal changed flag to the supplied value for a given
field, using |
| public void | changed(Name fieldName, boolean changed)
Set this record's internal changed flag to the supplied value for a given
field, using |
| public int | compareTo(Record
the object to be compared. record)Redeclares java. Record with another Record
according to their natural ordering.
|
| public boolean | |
| public void | |
| public void | from(Object
The source object to copy data from source, Field<?>... The record's fields to use for mapping fields)
Deprecated
as a consequence of
Load data into this record from a source, providing some fields, using
Field being deprecated.
field(Field) for lookup.
|
| public void | from(Object
The source object to copy data from source, String... The record's fields names to use for mapping fieldNames)Load data into this record from a source, providing some field names,
using |
| public void | from(Object
The source object to copy data from source, Name... The record's fields names to use for mapping fieldNames)Load data into this record from a source, providing some field names,
using |
| public void | |
| public void | |
| public void | fromArray(Object[] array, Field<?>... fields)
Deprecated
as a consequence of
Load data from an array into this record, providing some fields, using
Field being deprecated.
field(Field) for lookup.
|
| public void | fromArray(Object[] array, String... fieldNames)
Load data from an array into this record, providing some fields names,
using |
| public void | fromArray(Object[] array, Name... fieldNames)
Load data from an array into this record, providing some fields names,
using |
| public void | |
| public void | |
| public void | |
| public void | fromMap(Map<String, ?> map, String... fieldNames)
Load data from a map into this record, providing some field names, using
|
| public void | fromMap(Map<String, ?> map, Name... fieldNames)
Load data from a map into this record, providing some field names, using
|
| public void | |
| public < The generic field parameter T> T | Returns: The value of a field contained in this recordThe field field)
Deprecated
as a consequence of
Get a value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public < The conversion type parameter U> U | Returns: The value of a field contained in this recordThe field field, Class<? extends U> The conversion type type)
Deprecated
as a consequence of
Get a converted value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public < The database type parameter T, The conversion type parameter U> U | Returns: The value of a field contained in this recordThe field field, Converter<? super T, ? extends U> The data type converter converter)
Deprecated
as a consequence of
Get a converted value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public @Nullable Object | Returns: The value of a field's name contained in this recordThe field's name fieldName)Get a value from this Record, providing a field name, using
|
| public < The conversion type parameter U> U | Returns: The value of a field's name contained in this recordThe field's name fieldName, Class<? extends U> The conversion type type)Get a converted value from this Record, providing a field name, using
|
| public < The conversion type parameter U> U | Returns: The value of a field's name contained in this recordThe field's name fieldName, Converter<?, ? extends U> The data type converter converter)Get a converted value from this Record, providing a field name, using
|
| public @Nullable Object | Returns: The value of a field's name contained in this recordThe field's name fieldName)Get a value from this Record, providing a field name, using
|
| public < The conversion type parameter U> U | Returns: The value of a field's name contained in this recordThe field's name fieldName, Class<? extends U> The conversion type type)Get a converted value from this Record, providing a field name, using
|
| public < The conversion type parameter U> U | Returns: The value of a field's name contained in this recordThe field's name fieldName, Converter<?, ? extends U> The data type converter converter)Get a converted value from this Record, providing a field name, using
|
| public @Nullable Object | Returns: The value of a field's index contained in this recordThe 0-based field index in this record. index)Get a value from this record, providing a field index. |
| public < The conversion type parameter U> U | |
| public < The conversion type parameter U> U | |
| public <T> T | getValue(Field<T> field)
Deprecated
as a consequence of
Get a value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public <T> T | getValue(Field<?> field, Class<? extends T> type)
Deprecated
as a consequence of
Get a converted value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public <T, U> U | getValue(Field<T> field, Converter<? super T, ? extends U> converter)
Deprecated
as a consequence of
Get a converted value from this Record, providing a field, using
Field being deprecated.
field(Field) for lookup.
|
| public Object | getValue(String fieldName)
Get a value from this Record, providing a field name, using
|
| public <T> T | getValue(String fieldName, Class<? extends T> type)
Get a converted value from this Record, providing a field name, using
|
| public <U> U | getValue(String fieldName, Converter<?, ? extends U> converter)
Get a converted value from this Record, providing a field name, using
|
| public Object | getValue(Name fieldName)
Get a value from this Record, providing a field name, using
|
| public <T> T | getValue(Name fieldName, Class<? extends T> type)
Get a converted value from this Record, providing a field name, using
|
| public <U> U | getValue(Name fieldName, Converter<?, ? extends U> converter)
Get a converted value from this Record, providing a field name, using
|
| public Object | getValue(int
The 0-based field index in this record. index)Get a value from this record, providing a field index. |
| public <T> T | |
| public <U> U | |
| public int | Returns: A hash code value for this recordGet a hash code of this |
| public @NotNull Record | Returns: The new recordThe fields of the new record fields)
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1> @NotNull Record1 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2> @NotNull Record2 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3> @NotNull Record3 | |
| public <T1, T2, T3, T4> @NotNull Record4 | |
| public <T1, T2, T3, T4, T5> @NotNull Record5 | |
| public <T1, T2, T3, T4, T5, T6> @NotNull Record6 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7> @NotNull Record7 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8> @NotNull Record8 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9> @NotNull Record9 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> @NotNull Record10 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> @NotNull Record11 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> @NotNull Record12 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> @NotNull Record13 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> @NotNull Record14 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> @NotNull Record15 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> @NotNull Record16 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> @NotNull Record17 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> @NotNull Record18 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> @NotNull Record19 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> @NotNull Record20 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> @NotNull Record21 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> @NotNull Record22 | Returns: The new record
Deprecated
as a consequence of
Copy this record into a new record holding only a subset of the previous
fields, using Field being deprecated.
field(Field) for lookup.
|
| public < The generic entity type. E> E | |
| public < The generic entity type. E> E | |
| public < The generic table record type. R extends Record> R | |
| public @NotNull @Nullable Object[] | |
| public @NotNull List | |
| public @NotNull Map | |
| public @NotNull ResultSet | Returns: A wrapper JDBCResultSetGenerate an in-memory JDBC |
| public @NotNull Stream | |
| public <E> E | Returns: The custom mapped recordThe mapper callback mapper)Map this record into a custom mapper callback. |
| public @NotNull Record | |
| public <T> T | original(Field<T> field)
Deprecated
as a consequence of
Get an original value from this record as fetched from the database,
using Field being deprecated.
field(Field) for lookup.
|
| public @Nullable Object | original(int
The 0-based field index in this record. fieldIndex)Get an original value from this record as fetched from the database. |
| public @Nullable Object | original(String fieldName)
Get an original value from this record as fetched from the database,
using |
| public @Nullable Object | original(Name fieldName)
Get an original value from this record as fetched from the database,
using |
| public void | |
| public void | reset(Field<?> field)
Deprecated
as a consequence of
Reset a given value to its Field being deprecated.
original(Field) value and its
changed(Field) flag to false, using
field(Field) for lookup.
|
| public void | reset(int
The 0-based field index in this record. fieldIndex)Reset a given value to its |
| public void | reset(String fieldName)
Reset a given value to its |
| public void | reset(Name fieldName)
Reset a given value to its |
| public < The generic field parameter T> void | set(Field<T>
The field field, T The value value)
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|
| public < The generic field parameter T, The conversion type parameter U> void | set(Field<T>
The field field, U The value value, Converter<? extends T, ? super U> The converter used to convert converter)value into an
appropriate type
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|
| public <T> void | setValue(Field<T> field, T value)
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|
| public <T, U> void | setValue(Field<T> field, U value, Converter<? extends T, ? super U> converter)
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|
| public int | |
| public @NotNull Row | |
| public <T> @NotNull Record | with(Field<T> field, T value)
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|
| public <T, U> @NotNull Record | with(Field<T> field, U value, Converter<? extends T, ? super U> converter)
Deprecated
as a consequence of
Set a value into this record, using Field being deprecated.
field(Field) for lookup.
|