- Type Parameters:
R
- The record type
- All Superinterfaces:
Attachable
,Comparable<Record>
,Fields
,Formattable
,QualifiedRecord<R>
,Record
,Serializable
,SQLData
- All Known Subinterfaces:
UpdatableRecord<R>
- All Known Implementing Classes:
CustomRecord
,TableRecordImpl
,UpdatableRecordImpl
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescription<O extends UpdatableRecord<O>>
OfetchParent(ForeignKey<R,O> key)
Fetch a parent record of this record, given a foreign key.getTable()
The table from which this record was read.int
insert()
Store this record to the database using anINSERT
statement.int
insert(Collection<? extends Field<?>> fields)
Store parts of this record to the database using anINSERT
statement.int
Store parts of this record to the database using anINSERT
statement.original()
Get this record containing the original values as fetched from the database.<O extends UpdatableRecord<O>>
@NotNull Table<O>parent(ForeignKey<R,O> key)
Get a table expression representing the parent of this record, given a foreign key.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
-
Method Details
-
getTable
The table from which this record was read. -
original
Description copied from interface:Record
Get this record containing the original values 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 a new record containing those original values.
- Specified by:
original
in interfaceRecord
- See Also:
Record.original(Field)
,Record.original(int)
,Record.original(String)
-
insert
Store this record to the database using anINSERT
statement.If you want to enforce re-insertion this record's values, 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.- Returns:
1
if the record was stored to the database.0
if storing was not necessary andSettings.isInsertUnchangedRecords()
is set to false.- Throws:
DataAccessException
- if something went wrong executing the query
-
insert
Store parts of this record to the database using anINSERT
statement.- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
insert()
-
insert
Store parts of this record to the database using anINSERT
statement.- Returns:
1
if the record was stored to the database.0
if storing was not necessary.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
insert()
-
fetchParent
@Nullable @Support <O extends UpdatableRecord<O>> O fetchParent(ForeignKey<R,O> key) throws DataAccessExceptionFetch a parent record of this record, given a foreign key.This returns a parent record referenced by this record through a given foreign key, as if fetching from
parent(ForeignKey)
. If no parent 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, see https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/nested-records/.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
ForeignKey.fetchParent(Record)
,ForeignKey.fetchParents(java.util.Collection)
,ForeignKey.fetchParents(Record...)
-
parent
Get a table expression representing the parent of this record, given a foreign key.
-