- All Implemented Interfaces:
Serializable
,Comparable<Record>
,SQLData
,Attachable
,Fields
,Formattable
,QualifiedRecord<R>
,Record
,TableRecord<R>
,UpdatableRecord<R>
This type is for JOOQ INTERNAL USE only. Do not reference directly
- Author:
- Lukas Eder
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Attach this object to a newConfiguration
.final boolean
changed()
Check if this record has been changed from its original as fetched from the database.final void
changed
(boolean c) Set all of this record's internal changed flags to the supplied value.final boolean
changed
(int fieldIndex) Check if a field's value has been changed from its original as fetched from the database.final void
changed
(int fieldIndex, boolean c) Set this record's internal changed flag to the supplied value for a given field.final boolean
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(String)
for lookup.final void
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(String)
for lookup.final boolean
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(Field)
for lookup.final void
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(Field)
for lookup.final boolean
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(Name)
for lookup.final void
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(Name)
for lookup.final <O extends TableRecord<O>>
Table<O>children
(ForeignKey<O, R> key) Get a table expression representing the children of this record, given a foreign key.int
Compares thisRecord
with anotherRecord
according to their natural ordering.final Configuration
final R
copy()
Duplicate this record (in memory) and reset all fields from the primary key or main unique key, such that a subsequent call toUpdatableRecord.store()
will result in anINSERT
statement.protected final DSLContext
create()
Deprecated.final DataType<?>
dataType
(int fieldIndex) Get the field data type for a given field index, ornull
if no field is available at the index.final DataType<?>
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.final DataType<?>
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.final DataType<?>[]
Get an array of field data types for this type.final int
delete()
Deletes this record from the database, based on the value of the primary key or main unique key.final void
detach()
Detach this object from its currentConfiguration
.boolean
final <O extends TableRecord<O>>
OfetchChild
(ForeignKey<O, R> key) Fetch a child record of this record, given a foreign key.final <O extends TableRecord<O>>
Result<O>fetchChildren
(ForeignKey<O, R> key) Fetch child records of this record, given a foreign key.final Field<?>
field
(int index) Get a field known to this type by index, ornull
if no field is available at the index.final <T> Field<T>
Get a field known to this type by index coerced totype
, ornull
if no field is available at the index.final <T> Field<T>
Get a field known to this type by index coerced todataType
, ornull
if no field is available at the index.final Field<?>
Get a field known to this type by unqualified name, ornull
if no field is known to this type by this name.final <T> Field<T>
Get a field known to this type by unqualified name coerced totype
, ornull
if no field is known to this type by this name.final <T> Field<T>
Get a field known to this type by unqualified name coerced todataType
, ornull
if no field is known to this type by this name.final <T> Field<T>
Get a field known to this type by field reference.final Field<?>
Get a field known to this type by qualified name, ornull
if no field is known to this type by this name.final <T> Field<T>
Get a field known to this type by qualified name coerced totype
, ornull
if no field is known to this type by this name.final <T> Field<T>
Get a field known to this type by qualified name coerced todataType
, ornull
if no field is known to this type by this name.final Field<?>[]
fields()
Get all fields known to this type.final Field<?>[]
fields
(int... fieldIndexes) Get all fields known to this type, filtering by some field indexes.final Field<?>[]
Get all fields known to this type, filtering by some unqualified field names.final Field<?>[]
Get all fields, filtering by some fields.final Field<?>[]
Get all fields known to this type, filtering by some qualified field names.Get all fields known to this type as aRow
.Get all fields known to this type as aStream
.final String
format()
Get a simple formatted representation of this result.final String
format
(int maxRecords) Get a simple formatted representation of this result.final void
format
(OutputStream stream) LikeFormattable.format()
, but the data is output onto anOutputStream
.final void
format
(OutputStream stream, int maxRecords) LikeFormattable.format(int)
, but the data is output onto anOutputStream
.final void
format
(OutputStream stream, TXTFormat format) LikeFormattable.format(TXTFormat)
, but the data is output onto anOutputStream
.final void
LikeFormattable.format()
, but the data is output onto aWriter
.final void
LikeFormattable.format(int)
, but the data is output onto aWriter
.final void
LikeFormattable.format(TXTFormat)
, but the data is output onto aWriter
.final String
Get a simple formatted representation of this result.final String
Get this result as an ASCII chart.final void
formatChart
(OutputStream stream) LikeFormattable.formatChart()
, but the data is output onto anOutputStream
.final void
formatChart
(OutputStream stream, ChartFormat format) LikeFormattable.formatChart(ChartFormat)
, but the data is output onto anOutputStream
.final void
formatChart
(Writer writer) LikeFormattable.formatChart()
, but the data is output onto aWriter
.final void
formatChart
(Writer writer, ChartFormat format) LikeFormattable.formatChart(ChartFormat)
, but the data is output onto aWriter
.final String
formatChart
(ChartFormat format) Get this result as an ASCII chart.final String
Get a simple formatted representation of this result as CSV.final String
formatCSV
(boolean header) Get a simple formatted representation of this result as CSV.final String
formatCSV
(boolean header, char delimiter) Get a simple formatted representation of this result as CSV.final String
Get a simple formatted representation of this result as CSV.final String
formatCSV
(char delimiter) Get a simple formatted representation of this result as CSV.final String
Get a simple formatted representation of this result as CSV.final void
formatCSV
(OutputStream stream) LikeFormattable.formatCSV()
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, boolean header) LikeFormattable.formatCSV(boolean)
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, boolean header, char delimiter) LikeFormattable.formatCSV(boolean, char)
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, boolean header, char delimiter, String nullString) LikeFormattable.formatCSV(boolean, char, String)
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, char delimiter) LikeFormattable.formatCSV(char)
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, char delimiter, String nullString) LikeFormattable.formatCSV(char, String)
, but the data is output onto anOutputStream
.final void
formatCSV
(OutputStream stream, CSVFormat format) LikeFormattable.formatCSV(CSVFormat)
, but the data is output onto anOutputStream
.final void
LikeFormattable.formatCSV()
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(boolean)
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(boolean, char)
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(boolean, char, String)
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(char)
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(char, String)
, but the data is output onto aWriter
.final void
LikeFormattable.formatCSV(CSVFormat)
, but the data is output onto aWriter
.final String
Get a simple formatted representation of this result as CSV.final String
Get a simple formatted representation of this result as HTML.final void
formatHTML
(OutputStream stream) LikeFormattable.formatHTML()
, but the data is output onto anOutputStream
.final void
formatHTML
(Writer writer) LikeFormattable.formatHTML()
, but the data is output onto aWriter
.final String
Get this result as a set ofINSERT
statements.final void
formatInsert
(OutputStream stream) LikeFormattable.formatInsert()
, but the data is output onto anOutputStream
.final void
formatInsert
(OutputStream stream, Table<?> table, Field<?>... f) LikeFormattable.formatInsert(Table, Field...)
, but the data is output onto anOutputStream
.final void
formatInsert
(Writer writer) LikeFormattable.formatInsert()
, but the data is output onto aWriter
.final void
formatInsert
(Writer writer, Table<?> table, Field<?>... f) LikeFormattable.formatInsert(Table, Field...)
, but the data is output onto anWriter
.final String
formatInsert
(Table<?> table, Field<?>... f) Get this result as a set ofINSERT
statements.final String
Get a simple formatted representation of this result as a JSON array of array.final void
formatJSON
(OutputStream stream) LikeFormattable.formatJSON()
, but the data is output onto anOutputStream
.final void
formatJSON
(OutputStream stream, JSONFormat format) LikeFormattable.formatJSON(JSONFormat)
, but the data is output onto anOutputStream
.final void
formatJSON
(Writer writer) LikeFormattable.formatJSON()
, but the data is output onto aWriter
.final void
formatJSON
(Writer writer, JSONFormat format) LikeFormattable.formatJSON(JSONFormat)
, but the data is output onto aWriter
.final String
formatJSON
(JSONFormat format) Get a simple formatted representation of this result as a JSON data structure, according to the format.final String
Get this result formatted as XML.final void
formatXML
(OutputStream stream) LikeFormattable.formatXML()
, but the data is output onto anOutputStream
.final void
formatXML
(OutputStream stream, XMLFormat format) LikeFormattable.formatXML(XMLFormat)
, but the data is output onto anOutputStream
.final void
LikeFormattable.formatXML()
, but the data is output onto aWriter
.final void
LikeFormattable.formatXML(XMLFormat)
, but the data is output onto aWriter
.final String
Get this result formatted as XML.final void
Load data into this record from a source.final void
Load data into this record from a source, providing some field indexes.final void
Load data into this record from a source, providing some field names, usingFields.field(String)
for lookup.final void
Load data into this record from a source, providing some fields, usingFields.field(Field)
for lookup.final void
Load data into this record from a source, providing some field names, usingFields.field(Name)
for lookup.protected final void
This method was implemented with [#799].final void
Load data from an array into this record.final void
Load data from an array into this record, providing some fields indexes.final void
Load data from an array into this record, providing some fields names, usingFields.field(String)
for lookup.final void
Load data from an array into this record, providing some fields, usingFields.field(Field)
for lookup.final void
Load data from an array into this record, providing some fields names, usingFields.field(Name)
for lookup.final void
Load data from a map into this record, usingFields.field(String)
for lookup.final void
Load data from a map into this record, providing some field indexes.final void
Load data from a map into this record, providing some field names, usingFields.field(String)
for lookup.final void
Load data from a map into this record, providing some fields, usingFields.field(Field)
for lookup.final void
Load data from a map into this record, providing some field names, usingFields.field(Name)
for lookup.final Object
get
(int index) Get a value from this record, providing a field index.final <U> U
Get a converted value from this record, providing a field index.final <U> U
Get a converted value from this record, providing a field index.final Object
Get a value from this Record, providing a field name, usingFields.field(String)
for lookup.final <T> T
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.final <U> U
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.final <U> U
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.final <T> T
Get a value from this Record, providing a field, usingFields.field(Field)
for lookup.final <T,
U> U Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.final Object
Get a value from this Record, providing a field name, usingFields.field(Name)
for lookup.final <T> T
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.final <U> U
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.final RecordQualifier<R>
final String
final Object
getValue
(int index) Get a value from this record, providing a field index.final <T> T
Get a converted value from this record, providing a field index.final <U> U
Get a converted value from this record, providing a field index.final Object
Get a value from this Record, providing a field name, usingFields.field(String)
for lookup.final <T> T
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.final <U> U
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.final <T> T
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.final <T> T
Get a value from this Record, providing a field, usingFields.field(Field)
for lookup.final <T,
U> U Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.final Object
Get a value from this Record, providing a field name, usingFields.field(Name)
for lookup.final <T> T
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.final <U> U
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.int
hashCode()
final int
Get a field's index from this type.final int
Get a field's index from this type.final int
Get a field's index from this type.<E> E
into
(E object) Map resulting records onto a custom type.final <E> E
Map resulting records onto a custom type.final Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1> Record1<T1>
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2> Record2<T1, T2> Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3> Record3<T1, T2, T3> Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4>
Record4<T1,T2, T3, T4> Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5>
Record5<T1,T2, T3, T4, T5> Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6>
Record6<T1,T2, T3, T4, T5, T6> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7>
Record7<T1,T2, T3, T4, T5, T6, T7> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8>
Record8<T1,T2, T3, T4, T5, T6, T7, T8> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9>
Record9<T1,T2, T3, T4, T5, T6, T7, T8, T9> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10>
Record10<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
Record11<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
Record12<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
Record13<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
Record14<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
Record15<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
Record16<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>
Record17<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>
Record18<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>
Record19<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>
Record20<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>
Record21<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <T1,
T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>
Record22<T1,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> into
(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21, Field<T22> field22) Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup.final <R extends Record>
RMap resulting records onto a custom record type.final Object[]
Convert this record into an array.intoList()
Convert this record into a list.intoMap()
Return this record as a name/value map.final ResultSet
Generate an in-memory JDBCResultSet
containing the data of thisRecord
.Convert this record into a stream.final Document
intoXML()
Get this result as XML.final <H extends ContentHandler>
HintoXML
(H handler) Get this result as XML using a SAXContentHandler
.final <H extends ContentHandler>
HGet this result as XML using a SAXContentHandler
.final Document
Get this result as XML.key()
A Record copy holding values for theTable.getPrimaryKey()
.final <E> E
map
(RecordMapper<Record, E> mapper) Map this record into a custom mapper callback.final int
merge()
Store this record back to the database using aMERGE
statement.final int
merge
(Collection<? extends Field<?>> storeFields) Store parts of this record to the database using aMERGE
statement.int
Store parts of this record to the database using aMERGE
statement.final Object
original
(int fieldIndex) Get an original value from this record as fetched from the database.final Object
Get an original value from this record as fetched from the database, usingFields.field(String)
for lookup.final <T> T
Get an original value from this record as fetched from the database, usingFields.field(Field)
for lookup.final Object
Get an original value from this record as fetched from the database, usingFields.field(Name)
for lookup.final void
final void
refresh()
Refresh this record from the database.final void
refresh
(Collection<? extends Field<?>> refreshFields) Refresh parts of this record from the database.final void
Refresh parts of this record from the database.final void
reset()
final void
reset
(int fieldIndex) final void
Reset a given value to itsRecord.original(String)
value and itsRecord.changed(String)
flag tofalse
, usingFields.field(String)
for lookup.final void
Reset a given value to itsRecord.original(Field)
value and itsRecord.changed(Field)
flag tofalse
, usingFields.field(Field)
for lookup.final void
Reset a given value to itsRecord.original(Name)
value and itsRecord.changed(Name)
flag tofalse
, usingFields.field(Name)
for lookup.protected final void
final <T> void
Set a value into this record, usingFields.field(Field)
for lookup.final <T,
U> void Set a value into this record, usingFields.field(Field)
for lookup.protected final void
Deprecated.- UseAbstractRecord.set(int, Object)
insteadfinal <T> void
Set a value into this record, usingFields.field(Field)
for lookup.final <T,
U> void Set a value into this record, usingFields.field(Field)
for lookup.final int
size()
Get the number of fields of this record.final int
store()
Store this record back to the database.final int
store
(Collection<? extends Field<?>> storeFields) Store parts of this record to the database.final int
Store parts of this record to the database.toString()
final Class<?>
type
(int fieldIndex) Get the field type for a given field index, ornull
if no field is available at the index.final Class<?>
Get the field type for a given unqualified field name, ornull
if no field is known to this type by this name.final Class<?>
Get the field type for a given qualified field name, ornull
if no field is known to this type by this name.final Class<?>[]
types()
Get an array of field types for fields known to this type.final int
update()
Store this record back to the database using anUPDATE
statement.final int
update
(Collection<? extends Field<?>> storeFields) Store parts of this record to the database using anUPDATE
statement.int
Store parts of this record to the database using anUPDATE
statement.Get this record's values as aRow
.final <T> R
Set a value into this record, usingFields.field(Field)
for lookup.final <T,
U> R Set a value into this record, usingFields.field(Field)
for lookup.final void
Methods inherited from class org.jooq.impl.TableRecordImpl
fetchParent, getTable, insert, insert, insert, original, parent
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jooq.Attachable
attach, configuration, detach
Methods inherited from interface org.jooq.Fields
dataType, dataType, dataType, dataTypes, field, field, field, field, field, field, field, field, field, field, fields, fields, fields, fields, fields, fieldsRow, fieldStream, indexOf, indexOf, indexOf, type, type, type, types
Methods inherited from interface org.jooq.Formattable
format, format, format, format, format, format, format, format, format, formatChart, formatChart, formatChart, formatChart, formatChart, formatChart, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatCSV, formatHTML, formatHTML, formatHTML, formatInsert, formatInsert, formatInsert, formatInsert, formatInsert, formatInsert, formatJSON, formatJSON, formatJSON, formatJSON, formatJSON, formatJSON, formatXML, formatXML, formatXML, formatXML, formatXML, formatXML, intoXML, intoXML, intoXML, intoXML
Methods inherited from interface org.jooq.QualifiedRecord
getQualifier, with, with
Methods inherited from interface org.jooq.Record
changed, changed, changed, changed, changed, changed, changed, changed, changed, changed, compareTo, equals, from, from, from, from, from, fromArray, fromArray, fromArray, fromArray, fromArray, fromMap, fromMap, fromMap, fromMap, fromMap, get, get, get, get, get, get, get, get, get, get, get, get, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, hashCode, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, into, intoArray, intoList, intoMap, intoResultSet, intoStream, map, original, original, original, original, reset, reset, reset, reset, reset, set, set, setValue, setValue, size, valuesRow
Methods inherited from interface java.sql.SQLData
getSQLTypeName, readSQL, writeSQL
Methods inherited from interface org.jooq.TableRecord
fetchParent, getTable, original, parent
Methods inherited from interface org.jooq.UpdatableRecord
insert, insert, insert
-
Constructor Details
-
UpdatableRecordImpl
-
-
Method Details
-
key
Description copied from interface:UpdatableRecord
A Record copy holding values for theTable.getPrimaryKey()
.The returned record consists exactly of those fields as returned by the table's primary key:
Key.getFields()
.Generated subtypes may covariantly override this method to add more record type information. For instance, they may return
Record1
,Record2
, ...- Specified by:
key
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
-
fetchChild
Description copied from interface:UpdatableRecord
Fetch a child record of this record, given a foreign key.This returns a child record referencing this record through a given foreign key, as if fetching from
UpdatableRecord.children(ForeignKey)
.. If no child record was found, this returnsnull
.A separate roundtrip is created by this operation. It is often much better to include parent records using ordinary
JOIN
mechanisms in a single query, or using nested records, or theMULTISET
orMULTISET_AGG
operators, see https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/nested-records/, or the https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/multiset-value-constructor/.- Specified by:
fetchChild
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- See Also:
-
fetchChildren
Description copied from interface:UpdatableRecord
Fetch child records of this record, given a foreign key.This returns child records referencing this record through a given foreign key, as if fetching from
UpdatableRecord.children(ForeignKey)
.A separate roundtrip is created by this operation. It is often much better to include parent records using ordinary
JOIN
mechanisms in a single query, or using nested records, or theMULTISET
orMULTISET_AGG
operators, see https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/nested-records/, or the https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/multiset-value-constructor/.- Specified by:
fetchChildren
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- See Also:
-
children
Description copied from interface:UpdatableRecord
Get a table expression representing the children of this record, given a foreign key.- Specified by:
children
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
-
store
public final int store()Description copied from interface:UpdatableRecord
Store this record back to the database.Depending on the state of the primary key's value, an
UpdatableRecord.insert()
or anUpdatableRecord.update()
statement is executed.Statement type
- If this record was created by client code, an
INSERT
statement is executed - If this record was loaded by jOOQ and the primary key value was
changed, an
INSERT
statement is executed (unlessSettings.isUpdatablePrimaryKeys()
is set). jOOQ expects that primary key values will never change due to the principle of normalisation in RDBMS. So if client code changes primary key values, this is interpreted by jOOQ as client code wanting to duplicate this record. - If this record was loaded by jOOQ, and the primary key value was not
changed, an
UPDATE
statement is executed.
In either statement type, only those fields are inserted/updated, which had been explicitly set by client code, in order to allow for
DEFAULT
values to be applied by the underlying RDBMS. If no fields were modified, neither anUPDATE
nor anINSERT
will be executed.Automatic value generation
Use
UpdatableRecord.insert()
orUpdatableRecord.update()
to explicitly force either statement type.- IDENTITY columns
If there is an
IDENTITY
column defined on the record's underlying table (seeTable.getIdentity()
), then the auto-generatedIDENTITY
value is refreshed automatically onINSERT
's. Refreshing is done usingStatement.getGeneratedKeys()
, where this is supported by the JDBC driver. See alsoInsertQuery.getReturnedRecord()
for more details - VERSION and TIMESTAMP columns
jOOQ can auto-generate "version" and "timestamp" values that can be used for optimistic locking. If this is an
UpdatableRecord
and if this record returns fields for eitherTable.getRecordVersion()
orTable.getRecordTimestamp()
, then these values are set onto theINSERT
orUPDATE
statement being executed. On execution success, the generated values are set to this record. Use the code-generation configuration to specify naming patterns for auto-generated "version" and "timestamp" columns.Should you want to circumvent jOOQ-generated updates to these columns, you can render an
INSERT
orUPDATE
statement manually using the variousDSLContext.insertInto(Table)
,DSLContext.update(Table)
methods.
Optimistic locking
If an
UPDATE
statement is executed andSettings.isExecuteWithOptimisticLocking()
is set totrue
, then this record will first be compared with the latest state in the database. There are two modes of operation for optimistic locking:- With VERSION and/or TIMESTAMP columns configured
This is the preferred way of using optimistic locking in jOOQ. If this is an
UpdatableRecord
and if this record returns fields for eitherTable.getRecordVersion()
orTable.getRecordTimestamp()
, then these values are compared to the corresponding value in the database in theWHERE
clause of the executedDELETE
statement. - Without any specific column configurations
In order to compare this record with the latest state, the database record will be locked pessimistically using a
SELECT … FOR UPDATE
statement. Not all databases support theFOR UPDATE
clause natively. Namely, the following databases will show slightly different behaviour:SQLDialect.SQLSERVER
: jOOQ will try to lock the database record usingWITH (ROWLOCK, UPDLOCK)
hints.SQLDialect.SQLITE
: No pessimistic locking is possible. Client code must assure that no race-conditions can occur between jOOQ's checking of database record state and the actualUPDATE
See
SelectQuery.setForUpdate(boolean)
for more details
Statement examples
Possible statements are
INSERT INTO [table] ([modified fields, including keys]) VALUES ([modified values, including keys])
UPDATE [table] SET [modified fields = modified values, excluding keys] WHERE [key fields = key values] AND [version/timestamp fields = version/timestamp values]
Statement execution enforcement
If you want to control statement re-execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with
Record.changed(boolean)
or for single values withRecord.changed(Field, boolean)
, prior to storing. Consider also setting the flagsSettings.getUpdateUnchangedRecords()
and/orSettings.isInsertUnchangedRecords()
appropriately to control if the record should be "touched" without any changes (UPDATE
) or inserted with default values (INSERT
).This is the same as calling
record.store(record.fields())
- Specified by:
store
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
- If this record was created by client code, an
-
store
Description copied from interface:UpdatableRecord
Store parts of this record to the database.- Specified by:
store
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
-
store
Description copied from interface:UpdatableRecord
Store parts of this record to the database.- Specified by:
store
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
-
update
public final int update()Description copied from interface:UpdatableRecord
Store this record back to the database using anUPDATE
statement.This is the same as
UpdatableRecord.store()
, except that anUPDATE
statement (or no statement) will always be executed.If you want to enforce statement execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with
Record.changed(boolean)
or for single values withRecord.changed(Field, boolean)
, prior to updating, or alternatively, useSettings.getUpdateUnchangedRecords()
.This is the same as calling
record.update(record.fields())
- Specified by:
update
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
-
update
Description copied from interface:UpdatableRecord
Store parts of this record to the database using anUPDATE
statement.- Specified by:
update
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
-
update
Description copied from interface:UpdatableRecord
Store parts of this record to the database using anUPDATE
statement.- Specified by:
update
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- See Also:
-
merge
public final int merge()Description copied from interface:UpdatableRecord
Store this record back to the database using aMERGE
statement.Unlike
UpdatableRecord.store()
, the statement produced by this operation does not depend on whether the record has been previously fetched from the database or created afresh. It implements the semantics of anINSERT … ON DUPLICATE KEY UPDATE
statement, which will update the row regardless of which (unique) key value is already present. SeeInsertOnDuplicateStep.onDuplicateKeyUpdate()
.When optimistic locking is active for this record, then this operation will execute
UpdatableRecord.insert()
orUpdatableRecord.update()
explicitly, depending on whether the lock values are present already in the record.If you want to enforce statement execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with
Record.changed(boolean)
or for single values withRecord.changed(Field, boolean)
, prior to insertion.This is the same as calling
record.merge(record.fields())
- Specified by:
merge
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was merged to the database.0
if merging was not necessary.- See Also:
-
merge
Description copied from interface:UpdatableRecord
Store parts of this record to the database using aMERGE
statement.- Specified by:
merge
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was merged to the database.0
if merging was not necessary.- See Also:
-
merge
Description copied from interface:UpdatableRecord
Store parts of this record to the database using aMERGE
statement.- Specified by:
merge
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was merged to the database.0
if merging was not necessary.- See Also:
-
delete
public final int delete()Description copied from interface:UpdatableRecord
Deletes this record from the database, based on the value of the primary key or main unique key.Optimistic locking
If a
DELETE
statement is executed andSettings.isExecuteWithOptimisticLocking()
is set totrue
, then this record will first be compared with the latest state in the database. There are two modes of operation for optimistic locking:- With VERSION and/or TIMESTAMP columns configured
This is the preferred way of using optimistic locking in jOOQ. If this is an
UpdatableRecord
and if this record returns fields for eitherTable.getRecordVersion()
orTable.getRecordTimestamp()
, then these values are compared to the corresponding value in the database in theWHERE
clause of the executedDELETE
statement. - Without any specific column configurations
In order to compare this record with the latest state, the database record will be locked pessimistically using a
SELECT … FOR UPDATE
statement. Not all databases support theFOR UPDATE
clause natively. Namely, the following databases will show slightly different behaviour:SQLDialect.SQLSERVER
: jOOQ will try to lock the database record usingWITH (ROWLOCK, UPDLOCK)
hints.SQLDialect.SQLITE
: No pessimistic locking is possible. Client code must assure that no race-conditions can occur between jOOQ's checking of database record state and the actualDELETE
See
SelectQuery.setForUpdate(boolean)
for more details
Statement examples
The executed statement is
DELETE FROM [table] WHERE [key fields = key values] AND [version/timestamp fields = version/timestamp values]
This is in fact the same as calling
delete(getTable().getPrimaryKey().getFieldsArray())
- Specified by:
delete
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
1
if the record was deleted from the database.0
if deletion was not necessary.
- With VERSION and/or TIMESTAMP columns configured
-
refresh
public final void refresh()Description copied from interface:UpdatableRecord
Refresh this record from the database.A successful refresh results in the following:
Record.valuesRow()
will have been restored to the respective values from the databaseTableRecord.original()
will match this recordRecord.changed()
will befalse
Refreshing can trigger any of the following actions:
- Executing a new
SELECT
statement, if this is anUpdatableRecord
. - Failing, otherwise
This is the same as calling
record.refresh(record.fields())
- Specified by:
refresh
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
-
refresh
Description copied from interface:UpdatableRecord
Refresh parts of this record from the database.A successful refresh results in the following:
Record.valuesRow()
will have been restored to the respective values from the databaseTableRecord.original()
will match this recordRecord.changed()
will befalse
Refreshing can trigger any of the following actions:
- Executing a new
SELECT
statement, if this is anUpdatableRecord
. - Failing, otherwise
This is the same as calling
record.refresh(record.fields())
- Specified by:
refresh
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
-
refresh
Description copied from interface:UpdatableRecord
Refresh parts of this record from the database.A successful refresh results in the following:
Record.valuesRow()
will have been restored to the respective values from the databaseTableRecord.original()
will match this recordRecord.changed()
will befalse
Refreshing can trigger any of the following actions:
- Executing a new
SELECT
statement, if this is anUpdatableRecord
. - Failing, otherwise
This is the same as calling
record.refresh(record.fields())
- Specified by:
refresh
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
-
copy
Description copied from interface:UpdatableRecord
Duplicate this record (in memory) and reset all fields from the primary key or main unique key, such that a subsequent call toUpdatableRecord.store()
will result in anINSERT
statement.- Specified by:
copy
in interfaceUpdatableRecord<R extends UpdatableRecord<R>>
- Returns:
- A new record, distinct from
this
record.
-
getQualifier
Description copied from interface:QualifiedRecord
- Specified by:
getQualifier
in interfaceQualifiedRecord<R extends QualifiedRecord<R>>
-
with
Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.Like
Record.set(Field, Object)
but returningthis
for fluent setting of multiple values.- Specified by:
with
in interfaceQualifiedRecord<R extends QualifiedRecord<R>>
- Specified by:
with
in interfaceRecord
-
with
Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.Like
Record.set(Field, Object, Converter)
but returningthis
for fluent setting of multiple values.- Specified by:
with
in interfaceQualifiedRecord<R extends QualifiedRecord<R>>
- Specified by:
with
in interfaceRecord
-
fieldsRow
Description copied from interface:Fields
Get all fields known to this type as aRow
. -
valuesRow
Description copied from interface:Record
Get this record's values as aRow
. -
getSQLTypeName
- Specified by:
getSQLTypeName
in interfaceSQLData
- Throws:
SQLException
-
readSQL
- Specified by:
readSQL
in interfaceSQLData
- Throws:
SQLException
-
writeSQL
- Specified by:
writeSQL
in interfaceSQLData
- Throws:
SQLException
-
fields
Description copied from interface:Fields
Get all fields known to this type. -
fieldStream
Description copied from interface:Fields
Get all fields known to this type as aStream
.- Specified by:
fieldStream
in interfaceFields
-
field
Description copied from interface:Fields
Get a field known to this type by field reference.This will return:
- A field that is the same as the argument field (by identity comparison).
- A field that is equal to the argument field (exact matching fully qualified name).
- A field that is equal to the argument field (partially matching qualified name).
- A field whose name is equal to the unqualified name of the argument field.
null
otherwise.
If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by unqualified name, ornull
if no field is known to this type by this name.If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by unqualified name coerced totype
, ornull
if no field is known to this type by this name.If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by unqualified name coerced todataType
, ornull
if no field is known to this type by this name.If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by qualified name, ornull
if no field is known to this type by this name.This will return:
- A field whose name is equal to the argument field's name (exact matching fully qualified name).
- A field whose name is equal to the argument field's name (partially matching qualified name).
- A field whose name is equal to the unqualified name of the argument field.
null
otherwise.
If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by qualified name coerced totype
, ornull
if no field is known to this type by this name.This will return:
- A field whose name is equal to the argument field's name (exact matching fully qualified name).
- A field whose name is equal to the argument field's name (partially matching qualified name).
- A field whose name is equal to the unqualified name of the argument field.
null
otherwise.
If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by qualified name coerced todataType
, ornull
if no field is known to this type by this name.This will return:
- A field whose name is equal to the argument field's name (exact matching fully qualified name).
- A field whose name is equal to the argument field's name (partially matching qualified name).
- A field whose name is equal to the unqualified name of the argument field.
null
otherwise.
If several fields have the same ambiguous name, the first one is returned and a warning is logged.
-
field
Description copied from interface:Fields
Get a field known to this type by index, ornull
if no field is available at the index. -
field
Description copied from interface:Fields
Get a field known to this type by index coerced totype
, ornull
if no field is available at the index. -
field
Description copied from interface:Fields
Get a field known to this type by index coerced todataType
, ornull
if no field is available at the index. -
fields
Description copied from interface:Fields
Get all fields, filtering by some fields.- Specified by:
fields
in interfaceFields
- Parameters:
f
- The fields to include after looking them up viaFields.field(Field)
.- See Also:
-
fields
Description copied from interface:Fields
Get all fields known to this type, filtering by some unqualified field names.- Specified by:
fields
in interfaceFields
- Parameters:
fieldNames
- The unqualified field names to include after looking them up viaFields.field(String)
.- See Also:
-
fields
Description copied from interface:Fields
Get all fields known to this type, filtering by some qualified field names.- Specified by:
fields
in interfaceFields
- Parameters:
fieldNames
- The qualified field names to include after looking them up viaFields.field(Name)
.- See Also:
-
fields
Description copied from interface:Fields
Get all fields known to this type, filtering by some field indexes. -
indexOf
Description copied from interface:Fields
Get a field's index from this type.The lookup algorithm is the same as that of
Fields.field(Field)
. -
indexOf
Description copied from interface:Fields
Get a field's index from this type.The lookup algorithm is the same as that of
Fields.field(String)
. -
indexOf
Description copied from interface:Fields
Get a field's index from this type.The lookup algorithm is the same as that of
Fields.field(Name)
. -
types
Description copied from interface:Fields
Get an array of field types for fields known to this type.Entries in the resulting array correspond to
Typed.getType()
for the correspondingField
inFields.fields()
-
type
Description copied from interface:Fields
Get the field type for a given field index, ornull
if no field is available at the index. -
type
Description copied from interface:Fields
Get the field type for a given unqualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
Fields.field(String)
. -
type
Description copied from interface:Fields
Get the field type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
Fields.field(Name)
. -
dataTypes
Description copied from interface:Fields
Get an array of field data types for this type.Entries in the resulting array correspond to
Typed.getDataType()
for the correspondingField
inFields.fields()
-
dataType
Description copied from interface:Fields
Get the field data type for a given field index, ornull
if no field is available at the index. -
dataType
Description copied from interface:Fields
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
Fields.field(String)
. -
dataType
Description copied from interface:Fields
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
Fields.field(Name)
. -
size
public final int size()Description copied from interface:Record
Get the number of fields of this record. -
get
Description copied from interface:Record
Get a value from this Record, providing a field, usingFields.field(Field)
for lookup.If this record contains a field with the same
Field.getName()
as the argument field, that value is retrieved. -
get
Description copied from interface:Record
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.The
Converter
that is provided byConfiguration.converterProvider()
will be used to convert the value toU
If this record contains a field with the same
Field.getName()
as the argument field, that value is retrieved. -
get
Description copied from interface:Record
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.If this record contains a field with the same
Field.getName()
as the argument field, that value is retrieved. -
get
Description copied from interface:Record
Get a value from this record, providing a field index. -
get
Description copied from interface:Record
Get a converted value from this record, providing a field index.The
Converter
that is provided byConfiguration.converterProvider()
will be used to convert the value toU
-
get
Description copied from interface:Record
Get a converted value from this record, providing a field index. -
get
Description copied from interface:Record
Get a value from this Record, providing a field name, usingFields.field(String)
for lookup. -
get
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.The
Converter
that is provided byConfiguration.converterProvider()
will be used to convert the value toU
-
get
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup. -
get
Description copied from interface:Record
Get a value from this Record, providing a field name, usingFields.field(Name)
for lookup. -
get
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.The
Converter
that is provided byConfiguration.converterProvider()
will be used to convert the value toU
-
get
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup. -
setValue
Deprecated.- UseAbstractRecord.set(int, Object)
insteadSubclasses may type-unsafely set a value to a record index. This method takes care of converting the value to the appropriate type. -
set
-
set
Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.This will always set the
Record.changed(Field)
flag for the givenfield
, no matter if setting the value actually changes the value.Changing
Table.getPrimaryKey()
values will set allRecord.changed()
flags to true, in order to produce completeINSERT
statements on subsequentUpdatableRecord.store()
operations. -
set
Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.This will always set the
Record.changed(Field)
flag for the givenfield
, no matter if setting the value actually changes the value.Changing
Table.getPrimaryKey()
values will set allRecord.changed()
flags to true, in order to produce completeINSERT
statements on subsequentUpdatableRecord.store()
operations. -
original
Description copied from interface:Record
Get an original value from this record as fetched from the database, usingFields.field(Field)
for lookup.Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.
-
original
Description copied from interface:Record
Get an original value from this record as fetched from the database.Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.
-
original
Description copied from interface:Record
Get an original value from this record as fetched from the database, usingFields.field(String)
for lookup.Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.
-
original
Description copied from interface:Record
Get an original value from this record as fetched from the database, usingFields.field(Name)
for lookup.Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.
-
changed
public final boolean changed()Description copied from interface:Record
Check if this record has been changed from its original as fetched from the database.If this returns
false
, then it can be said thatrecord.equals(record.original())
is true. -
changed
Description copied from interface:Record
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(Field)
for lookup. -
changed
public final boolean changed(int fieldIndex) Description copied from interface:Record
Check if a field's value has been changed from its original as fetched from the database. -
changed
Description copied from interface:Record
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(String)
for lookup. -
changed
Description copied from interface:Record
Check if a field's value has been changed from its original as fetched from the database, usingFields.field(Name)
for lookup. -
changed
public final void changed(boolean c) Description copied from interface:Record
Set all of this record's internal changed flags to the supplied value.If the
changed
argument isfalse
, theRecord.original()
values will be reset to the corresponding "current" values as well -
changed
Description copied from interface:Record
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(Field)
for lookup.If the
changed
argument isfalse
, theRecord.original(Field)
value will be reset to the corresponding "current" value as well -
changed
public final void changed(int fieldIndex, boolean c) Description copied from interface:Record
Set this record's internal changed flag to the supplied value for a given field.If the
changed
argument isfalse
, theRecord.original(int)
value will be reset to the corresponding "current" value as well -
changed
Description copied from interface:Record
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(String)
for lookup.If the
changed
argument isfalse
, theRecord.original(String)
value will be reset to the corresponding "current" value as well -
changed
Description copied from interface:Record
Set this record's internal changed flag to the supplied value for a given field, usingFields.field(Name)
for lookup.If the
changed
argument isfalse
, theRecord.original(Name)
value will be reset to the corresponding "current" value as well -
reset
public final void reset()Description copied from interface:Record
-
reset
Description copied from interface:Record
Reset a given value to itsRecord.original(Field)
value and itsRecord.changed(Field)
flag tofalse
, usingFields.field(Field)
for lookup. -
reset
public final void reset(int fieldIndex) Description copied from interface:Record
-
reset
Description copied from interface:Record
Reset a given value to itsRecord.original(String)
value and itsRecord.changed(String)
flag tofalse
, usingFields.field(String)
for lookup. -
reset
Description copied from interface:Record
Reset a given value to itsRecord.original(Name)
value and itsRecord.changed(Name)
flag tofalse
, usingFields.field(Name)
for lookup. -
intoArray
Description copied from interface:Record
Convert this record into an array.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)
-
intoList
Description copied from interface:Record
Convert this record into a list.The resulting list 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.intoList().get(i)
This is the same as calling
Arrays.asList(intoArray())
-
intoStream
Description copied from interface:Record
Convert this record into a stream.The resulting stream has the same number of elements as this record has fields. The resulting stream contains data as such:
This is the same as calling
into(Stream.class)
- Specified by:
intoStream
in interfaceRecord
- Returns:
- This record as a stream
-
intoMap
Description copied from interface:Record
Return this record as a name/value map.This is the inverse operation to
Record.fromMap(Map)
-
into
Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record3<T1,T3> T2, intoT3> (Field<T1> field1, Field<T2> field2, Field<T3> field3) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record4<T1,T3, T4> T2, intoT3, T4> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record5<T1,T3, T4, T5> T2, intoT3, T4, T5> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record6<T1,T3, T4, T5, T6> T2, intoT3, T4, T5, T6> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record7<T1,T3, T4, T5, T6, T7> T2, intoT3, T4, T5, T6, T7> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record8<T1,T3, T4, T5, T6, T7, T8> T2, intoT3, T4, T5, T6, T7, T8> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record9<T1,T3, T4, T5, T6, T7, T8, T9> T2, intoT3, T4, T5, T6, T7, T8, T9> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record10<T1,T3, T4, T5, T6, T7, T8, T9, T10> T2, intoT3, T4, T5, T6, T7, T8, T9, T10> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record11<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record12<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record13<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record14<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record15<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record16<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record17<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record18<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record19<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record20<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record21<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
public final <T1,T2, Record22<T1,T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> T2, intoT3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> (Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21, Field<T22> field22) Description copied from interface:Record
Copy this record into a new record holding only a subset of the previous fields, usingFields.field(Field)
for lookup. -
into
Description copied from interface:Record
Map resulting records onto a custom type.This will map this record onto your custom type using a
RecordMapper
as provided byConfiguration.recordMapperProvider()
. If no custom provider is specified, theDefaultRecordMapperProvider
is used. -
into
public <E> E into(E object) Description copied from interface:Record
Map resulting records onto a custom type.This is the same as
Record.into(Class)
, except that no new object is instantiated as a result. Instead, you can provide your own custom POJO instance. -
into
Description copied from interface:Record
Map resulting records onto a custom record type.The mapping algorithm is this:
jOOQ will map
Record
values by equal field names:- For every field in the
table
argument withField.getName()
"MY_field"
(case-sensitive!), a corresponding field with the same name in this record will be searched. - If several fields in this record share the same
Field.getName()
, then the first one returning true onField.equals(Object)
will be returned. (e.g. qualified field names match)
Other restrictions
RecordQualifier.getRecordType()
must return a class of typeTableRecord
, which must provide a default constructor. Non-public default constructors are made accessible usingConstructor.setAccessible(boolean)
- For every field in the
-
intoResultSet
Description copied from interface:Record
Generate an in-memory JDBCResultSet
containing the data of thisRecord
.Use this as an adapter for JDBC-compliant code that expects a
ResultSet
to operate on, rather than a jOOQResult
. The returnedResultSet
allows for the following behaviour according to the JDBC specification:ResultSet.CLOSE_CURSORS_AT_COMMIT
: The cursors (i.e.Statement
object) are no longer availableResultSet.CONCUR_READ_ONLY
: You cannot update the database through thisResultSet
, as the underlyingResult
object does not hold any open database refences anymoreResultSet.FETCH_FORWARD
: The fetch direction is forward only, and cannot be changedResultSet.TYPE_SCROLL_INSENSITIVE
: You can use any of theResultSet
's scrolling methods, e.g.ResultSet.next()
orResultSet.previous()
, etc.
You may use
DSLContext.fetch(ResultSet)
to unwind this wrapper again.This is the same as creating a new
Result
with thisRecord
only, and then callingResult.intoResultSet()
on thatResult
- Specified by:
intoResultSet
in interfaceRecord
- Returns:
- A wrapper JDBC
ResultSet
-
map
Description copied from interface:Record
Map this record into a custom mapper callback. -
from
Description copied from interface:Record
Load data into this record from a source.The mapping algorithm is this:
If
source
is anarray
Loading of data is delegated to
Record.fromArray(Object...)
If
source
is aMap
Loading of data is delegated to
Record.fromMap(Map)
If
source
is anIterable
Loading of data is equivalent to loading
Record.fromArray(Object...)
, transforming theIterable
to an array, first.If any JPA
Column
annotations are found on theClass
of the providedsource
, only those are used. Matching candidates are:- Public no-argument instance methods annotated with
Column
- Public no-argument instance methods starting with
getXXX
orisXXX
, if there exists a matching public single-argumentsetXXX()
instance method that is annotated withColumn
- Public instance member fields annotated with
Column
Column.name()
must matchField.getName()
. All other annotation attributes are ignored- Only the first match per field is used
- Matching methods have a higher priority than matching member fields
- Explicitly matching methods have a higher priority than implicitly matching methods (implicitly matching getter = setter is annotated)
- Static methods / member fields are ignored
If there are no JPA
Column
annotations, or jOOQ can't find thejakarta.persistence
API on the classpath, jOOQ will map members by naming convention:If
Field.getName()
isMY_field
(case-sensitive!), then this field's value will be fetched from the first of these:- Public no-argument instance method
MY_field()
- Public no-argument instance method
myField()
- Public no-argument instance method
getMY_field()
- Public no-argument instance method
getMyField()
- Public instance member field
MY_field
- Public instance member field
myField
Other restrictions
- primitive types are supported.
General notes
The resulting record will have its internal "changed" flags set to true for all values. This means that
UpdatableRecord.store()
will perform anINSERT
statement. If you wish to store the record using anUPDATE
statement, useDSLContext.executeUpdate(UpdatableRecord)
instead.This is the same as calling
record.from(source, record.fields())
- Public no-argument instance methods annotated with
-
from
Description copied from interface:Record
Load data into this record from a source, providing some fields, usingFields.field(Field)
for lookup.This is the same as
Record.from(Object)
, except that only fields contained in thefields
argument will be mapped. -
from
Description copied from interface:Record
Load data into this record from a source, providing some field names, usingFields.field(String)
for lookup.This is the same as
Record.from(Object)
, except that only fields contained in thefieldNames
argument will be mapped. -
from
Description copied from interface:Record
Load data into this record from a source, providing some field names, usingFields.field(Name)
for lookup.This is the same as
Record.from(Object)
, except that only fields contained in thefieldNames
argument will be mapped. -
from
Description copied from interface:Record
Load data into this record from a source, providing some field indexes.This is the same as
Record.from(Object)
, except that only fields contained in thefieldIndexes
argument will be mapped. -
fromMap
Description copied from interface:Record
Load data from a map into this record, usingFields.field(String)
for lookup.The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by
Fields.field(String)
. Missing fields will be left untouched. Excess fields will be ignored.This is the inverse operation to
Record.intoMap()
. This is the same as callingrecord.fromMap(map, record.fields())
-
fromMap
Description copied from interface:Record
Load data from a map into this record, providing some fields, usingFields.field(Field)
for lookup.The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by
Fields.field(String)
. Missing fields will be left untouched. Excess fields will be ignored.This is the same as
Record.fromMap(Map)
, except that only fields contained in thefields
argument will be mapped. -
fromMap
Description copied from interface:Record
Load data from a map into this record, providing some field names, usingFields.field(String)
for lookup.The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by
Fields.field(String)
. Missing fields will be left untouched. Excess fields will be ignored.This is the same as
Record.fromMap(Map)
, except that only fields contained in thefieldNames
argument will be mapped. -
fromMap
Description copied from interface:Record
Load data from a map into this record, providing some field names, usingFields.field(Name)
for lookup.The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by
Fields.field(Name)
. Missing fields will be left untouched. Excess fields will be ignored.This is the same as
Record.fromMap(Map)
, except that only fields contained in thefieldNames
argument will be mapped. -
fromMap
Description copied from interface:Record
Load data from a map into this record, providing some field indexes.The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by
Fields.field(String)
. Missing fields will be left untouched. Excess fields will be ignored.This is the same as
Record.fromMap(Map)
, except that only fields contained in thefieldIndexes
argument will be mapped. -
fromArray
Description copied from interface:Record
Load data from an array into this record.The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.
This is the inverse operation to
Record.intoArray()
-
fromArray
Description copied from interface:Record
Load data from an array into this record, providing some fields, usingFields.field(Field)
for lookup.The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.
This is the same as
Record.fromArray(Object...)
, except that only fields contained in thefields
argument will be mapped. -
fromArray
Description copied from interface:Record
Load data from an array into this record, providing some fields names, usingFields.field(String)
for lookup.The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.
This is the same as
Record.fromArray(Object...)
, except that only fields contained in thefieldNames
argument will be mapped. -
fromArray
Description copied from interface:Record
Load data from an array into this record, providing some fields names, usingFields.field(Name)
for lookup.The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.
This is the same as
Record.fromArray(Object...)
, except that only fields contained in thefieldNames
argument will be mapped. -
fromArray
Description copied from interface:Record
Load data from an array into this record, providing some fields indexes.The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.
This is the same as
Record.fromArray(Object...)
, except that only fields contained in thefieldIndexes
argument will be mapped. -
from
This method was implemented with [#799]. It may be useful to make it public for broader use...? -
format
Description copied from interface:Formattable
LikeFormattable.format(TXTFormat)
, but the data is output onto aWriter
.- Specified by:
format
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(CSVFormat)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatJSON
Description copied from interface:Formattable
LikeFormattable.formatJSON(JSONFormat)
, but the data is output onto aWriter
.- Specified by:
formatJSON
in interfaceFormattable
-
formatXML
Description copied from interface:Formattable
LikeFormattable.formatXML(XMLFormat)
, but the data is output onto aWriter
.- Specified by:
formatXML
in interfaceFormattable
-
formatHTML
Description copied from interface:Formattable
LikeFormattable.formatHTML()
, but the data is output onto aWriter
.- Specified by:
formatHTML
in interfaceFormattable
-
formatChart
Description copied from interface:Formattable
LikeFormattable.formatChart(ChartFormat)
, but the data is output onto aWriter
.- Specified by:
formatChart
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
LikeFormattable.formatInsert()
, but the data is output onto aWriter
.- Specified by:
formatInsert
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
LikeFormattable.formatInsert(Table, Field...)
, but the data is output onto anWriter
.- Specified by:
formatInsert
in interfaceFormattable
-
intoXML
Description copied from interface:Formattable
Get this result as XML.- Specified by:
intoXML
in interfaceFormattable
- See Also:
-
intoXML
Description copied from interface:Formattable
Get this result as XML using a SAXContentHandler
.- Specified by:
intoXML
in interfaceFormattable
- Parameters:
handler
- The custom content handler.- Returns:
- The argument content handler is returned for convenience.
- Throws:
SAXException
- See Also:
-
toString
-
compareTo
Description copied from interface:Record
Compares thisRecord
with anotherRecord
according to their natural ordering.jOOQ Records implement
Comparable
to allow for naturally ordering Records in a "SQL way", i.e. according to the following rules:Records being compared must have the same ROW type
Two Records are comparable if and only if they have the same
ROW
type, i.e. if theirfieldsRow()
methods return fields of the same type and degree.Comparison rules
Assume the following notations:
X[i]
meansX.getValue(i)
X = Y
meansX.compareTo(Y) == 0
X < Y
meansX.compareTo(Y) < 0
X[i] = Y[i]
means(X[i] == null && Y[i] == null) || X[i].compareTo(Y[i]) == 0
X[i] < Y[i]
meansY[i] == null || X[i].compareTo(Y[i]) < 0
. This corresponds to the SQLNULLS LAST
clause.
r1
andr2
,x = r1.compareTo(r2)
yields:x = -1
: if(r1[0] < r2[0]) OR (r1[0] = r2[0] AND r1[1] < r2[1]) OR ... OR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] < r2[N])
x = 0
: ifOR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] = r2[N])
x = 1
: if(r1[0] > r2[0]) OR (r1[0] = r2[0] AND r1[1] > r2[1]) OR ... OR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] > r2[N])
Note, that the above rules correspond to the SQL ordering behaviour as illustrated in the following examples:
-- A SQL ORDER BY clause, ordering all records by columns in their order SELECT a, b, c FROM my_table ORDER BY 1, 2, 3 -- A row value expression comparison predicate SELECT * FROM my_table WHERE (a, b, c) < (1, 2, 3)
See
Row1.lessThan(Row1)
,Row2.lessThan(Row2)
, ...,Row22.lessThan(Row22)
for more details about row value expression comparison predicatesAlternative sorting behaviour can be achieved through
Result.sortAsc(java.util.Comparator)
and similar methods.- Specified by:
compareTo
in interfaceComparable<Record>
- Specified by:
compareTo
in interfaceRecord
-
getValue
Description copied from interface:Record
Get a value from this Record, providing a field, usingFields.field(Field)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(Field)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.[#2211] Future versions of jOOQ might remove tthis method. It is recommended to use
Record.get(Field, Class)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field, usingFields.field(Field)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(Field, Converter)
instead. -
getValue
Description copied from interface:Record
Get a value from this record, providing a field index.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(int)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this record, providing a field index.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(int, Class)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this record, providing a field index.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(int, Converter)
instead. -
getValue
Description copied from interface:Record
Get a value from this Record, providing a field name, usingFields.field(String)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(String)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(String, Class)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(String)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(String, Converter)
instead. -
getValue
Description copied from interface:Record
Get a value from this Record, providing a field name, usingFields.field(Name)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(Name)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(Name, Class)
instead. -
getValue
Description copied from interface:Record
Get a converted value from this Record, providing a field name, usingFields.field(Name)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.get(Name, Converter)
instead. -
setValue
Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.set(Field, Object)
instead. -
setValue
public final <T,U> void setValue(Field<T> field, U value, Converter<? extends T, ? super U> converter) Description copied from interface:Record
Set a value into this record, usingFields.field(Field)
for lookup.[#2211] Future versions of jOOQ might remove this method. It is recommended to use
Record.set(Field, Object, Converter)
instead. -
create
Deprecated.- 3.11.0 - [#6720] [#6721] - UseAttachable.configuration()
andConfiguration.dsl()
instead.This method is used in generated code! -
hashCode
public int hashCode() -
equals
-
attach
Description copied from interface:Attachable
Attach this object to a newConfiguration
.- Specified by:
attach
in interfaceAttachable
- Parameters:
c
- A configuration ornull
, if you wish to detach thisAttachable
from its previous configuration.
-
detach
public final void detach()Description copied from interface:Attachable
Detach this object from its currentConfiguration
.This is the same as calling
attach(null)
.- Specified by:
detach
in interfaceAttachable
-
configuration
Description copied from interface:Attachable
- Specified by:
configuration
in interfaceAttachable
-
format
Description copied from interface:Formattable
Get a simple formatted representation of this result.This is the same as calling
Formattable.format(int)
withmaxRows = Integer.MAX_VALUE
- Specified by:
format
in interfaceFormattable
- Returns:
- The formatted result
-
format
Description copied from interface:Formattable
Get a simple formatted representation of this result.- Specified by:
format
in interfaceFormattable
- Parameters:
maxRecords
- The maximum number of records to include in the formatted result- Returns:
- The formatted result
-
format
Description copied from interface:Formattable
Get a simple formatted representation of this result.- Specified by:
format
in interfaceFormattable
- Parameters:
format
- The formatting information- Returns:
- The formatted result
-
format
Description copied from interface:Formattable
LikeFormattable.format()
, but the data is output onto anOutputStream
.- Specified by:
format
in interfaceFormattable
-
format
Description copied from interface:Formattable
LikeFormattable.format(int)
, but the data is output onto anOutputStream
.- Specified by:
format
in interfaceFormattable
-
format
Description copied from interface:Formattable
LikeFormattable.format(TXTFormat)
, but the data is output onto anOutputStream
.- Specified by:
format
in interfaceFormattable
-
format
Description copied from interface:Formattable
LikeFormattable.format()
, but the data is output onto aWriter
.- Specified by:
format
in interfaceFormattable
-
format
Description copied from interface:Formattable
LikeFormattable.format(int)
, but the data is output onto aWriter
.- Specified by:
format
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, ',', "")
- Specified by:
formatCSV
in interfaceFormattable
- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(',', "")
- Specified by:
formatCSV
in interfaceFormattable
- Parameters:
header
- Whether to emit a CSV header line- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, delimiter, "")
- Specified by:
formatCSV
in interfaceFormattable
- Parameters:
delimiter
- The delimiter to use between records- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(delimiter, "")
- Specified by:
formatCSV
in interfaceFormattable
- Parameters:
header
- Whether to emit a CSV header linedelimiter
- The delimiter to use between records- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.This is the same as calling
formatCSV(true, delimiter, nullString)
- Specified by:
formatCSV
in interfaceFormattable
- Parameters:
delimiter
- The delimiter to use between recordsnullString
- A special string for encodingNULL
values.- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.- Specified by:
formatCSV
in interfaceFormattable
- Parameters:
header
- Whether to emit a CSV header linedelimiter
- The delimiter to use between recordsnullString
- A special string for encodingNULL
values.- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
Get a simple formatted representation of this result as CSV.- Specified by:
formatCSV
in interfaceFormattable
- Returns:
- The formatted result
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV()
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(char)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean, char)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(char, String)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean, char, String)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(CSVFormat)
, but the data is output onto anOutputStream
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV()
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(char)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean, char)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(char, String)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatCSV
Description copied from interface:Formattable
LikeFormattable.formatCSV(boolean, char, String)
, but the data is output onto aWriter
.- Specified by:
formatCSV
in interfaceFormattable
-
formatJSON
Description copied from interface:Formattable
Get a simple formatted representation of this result as a JSON array of array.The format is the following:
{"fields":[{"name":"field-1","type":"type-1"}, {"name":"field-2","type":"type-2"}, ..., {"name":"field-n","type":"type-n"}], "records":[[value-1-1,value-1-2,...,value-1-n], [value-2-1,value-2-2,...,value-2-n]]}
- Specified by:
formatJSON
in interfaceFormattable
- Returns:
- The formatted result
-
formatJSON
Description copied from interface:Formattable
Get a simple formatted representation of this result as a JSON data structure, according to the format.- Specified by:
formatJSON
in interfaceFormattable
- Returns:
- The formatted result
- See Also:
-
formatJSON
Description copied from interface:Formattable
LikeFormattable.formatJSON()
, but the data is output onto anOutputStream
.- Specified by:
formatJSON
in interfaceFormattable
-
formatJSON
Description copied from interface:Formattable
LikeFormattable.formatJSON(JSONFormat)
, but the data is output onto anOutputStream
.- Specified by:
formatJSON
in interfaceFormattable
-
formatJSON
Description copied from interface:Formattable
LikeFormattable.formatJSON()
, but the data is output onto aWriter
.- Specified by:
formatJSON
in interfaceFormattable
-
formatXML
Description copied from interface:Formattable
Get this result formatted as XML.- Specified by:
formatXML
in interfaceFormattable
- See Also:
-
formatXML
Description copied from interface:Formattable
Get this result formatted as XML.- Specified by:
formatXML
in interfaceFormattable
- See Also:
-
formatXML
Description copied from interface:Formattable
LikeFormattable.formatXML()
, but the data is output onto anOutputStream
.- Specified by:
formatXML
in interfaceFormattable
-
formatXML
Description copied from interface:Formattable
LikeFormattable.formatXML(XMLFormat)
, but the data is output onto anOutputStream
.- Specified by:
formatXML
in interfaceFormattable
-
formatXML
Description copied from interface:Formattable
LikeFormattable.formatXML()
, but the data is output onto aWriter
.- Specified by:
formatXML
in interfaceFormattable
-
formatChart
Description copied from interface:Formattable
Get this result as an ASCII chart.- Specified by:
formatChart
in interfaceFormattable
- See Also:
-
formatChart
Description copied from interface:Formattable
Get this result as an ASCII chart.When running a query like this:
Where the formatted result would look like this:String chart = create.select( BOOK_TO_BOOK_STORE.BOOK_STORE_NAME, count(BOOK_TO_BOOK_STORE.BOOK_ID).as("books") ) .from(BOOK_TO_BOOK_STORE) .groupBy(BOOK_TO_BOOK_STORE.BOOK_STORE_NAME) .fetch() .formatChart();
+-------------------------+-----+ |BOOK_STORE_NAME |books| +-------------------------+-----+ |Buchhandlung im Volkshaus| 1| |Ex Libris | 2| |Orell Füssli | 3| +-------------------------+-----+
Then the chart might look something like this:3.00| █████████████████████████ 2.91| █████████████████████████ 2.82| █████████████████████████ 2.73| █████████████████████████ 2.64| █████████████████████████ 2.55| █████████████████████████ 2.45| █████████████████████████ 2.36| █████████████████████████ 2.27| █████████████████████████ 2.18| █████████████████████████ 2.09| █████████████████████████ 2.00| ██████████████████████████████████████████████████ 1.91| ██████████████████████████████████████████████████ 1.82| ██████████████████████████████████████████████████ 1.73| ██████████████████████████████████████████████████ 1.64| ██████████████████████████████████████████████████ 1.55| ██████████████████████████████████████████████████ 1.45| ██████████████████████████████████████████████████ 1.36| ██████████████████████████████████████████████████ 1.27| ██████████████████████████████████████████████████ 1.18| ██████████████████████████████████████████████████ 1.09| ██████████████████████████████████████████████████ 1.00|███████████████████████████████████████████████████████████████████████████ ----+--------------------------------------------------------------------------- | Buchhandlung im Volkshaus Ex Libris Orell Füssli
It is possible to specify a variety ofChartFormat
formatting specifications, such as the width, height, display type (default, stacked, 100% stacked), the column index of the category and value columns, etc.- Specified by:
formatChart
in interfaceFormattable
- See Also:
-
formatChart
Description copied from interface:Formattable
LikeFormattable.formatChart()
, but the data is output onto anOutputStream
.- Specified by:
formatChart
in interfaceFormattable
-
formatChart
Description copied from interface:Formattable
LikeFormattable.formatChart(ChartFormat)
, but the data is output onto anOutputStream
.- Specified by:
formatChart
in interfaceFormattable
-
formatChart
Description copied from interface:Formattable
LikeFormattable.formatChart()
, but the data is output onto aWriter
.- Specified by:
formatChart
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
Get this result as a set ofINSERT
statements.This uses the the first record's
TableRecord.getTable()
, if the first record is aTableRecord
. Otherwise, this generatesINSERT
statements into an"UNKNOWN_TABLE"
. In both cases, theFields.fields()
are used for column names.- Specified by:
formatInsert
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
LikeFormattable.formatInsert()
, but the data is output onto anOutputStream
.- Specified by:
formatInsert
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
Get this result as a set ofINSERT
statements.This explicitly specifies the table (and optionally the fields) to insert into. If the
fields
argument is left empty, theFields.fields()
are used, instead.- Specified by:
formatInsert
in interfaceFormattable
-
formatInsert
Description copied from interface:Formattable
LikeFormattable.formatInsert(Table, Field...)
, but the data is output onto anOutputStream
.- Specified by:
formatInsert
in interfaceFormattable
-
formatHTML
Description copied from interface:Formattable
Get a simple formatted representation of this result as HTML.The HTML code is formatted as follows:
<table> <thead> <tr> <th>field-1</th> <th>field-2</th> ... <th>field-n</th> </tr> </thead> <tbody> <tr> <th>value-1-1</th> <th>value-1-2</th> ... <th>value-1-n</th> </tr> <tr> <th>value-2-1</th> <th>value-2-2</th> ... <th>value-2-n</th> </tr> ... </tbody> </table>
- Specified by:
formatHTML
in interfaceFormattable
- Returns:
- The formatted result
-
formatHTML
Description copied from interface:Formattable
LikeFormattable.formatHTML()
, but the data is output onto anOutputStream
.- Specified by:
formatHTML
in interfaceFormattable
-
intoXML
Description copied from interface:Formattable
Get this result as XML.- Specified by:
intoXML
in interfaceFormattable
- See Also:
-
intoXML
Description copied from interface:Formattable
Get this result as XML using a SAXContentHandler
.- Specified by:
intoXML
in interfaceFormattable
- Parameters:
handler
- The custom content handler.- Returns:
- The argument content handler is returned for convenience.
- Throws:
SAXException
- See Also:
-
Attachable.configuration()
andConfiguration.dsl()
instead.