- 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.intinsert()Store this record to the database using anINSERTstatement.intinsert(Collection<? extends Field<?>> fields) Store parts of this record to the database using anINSERTstatement.intStore parts of this record to the database using anINSERTstatement.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, detachMethods 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, fieldsIncludingHidden, fieldsRow, fieldStream, indexOf, indexOf, indexOf, type, type, type, typesMethods 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, intoXMLMethods inherited from interface org.jooq.QualifiedRecord
getQualifier, with, withMethods 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, modified, modified, modified, modified, modified, original, original, original, original, reset, reset, reset, reset, reset, set, set, setValue, setValue, size, touched, touched, touched, touched, touched, touched, touched, touched, touched, touched, valuesRowMethods 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:RecordGet 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.
-
insert
Store this record to the database using anINSERTstatement.If you want to enforce re-insertion this record's values, regardless if the values in this record were
Record.modified(), you can explicitly set the touched flags for all values withRecord.touched(boolean)or for single values withRecord.touched(Field, boolean), prior to insertion, ifSettings.getRecordDirtyTracking()is set toRecordDirtyTracking.TOUCHED- Returns:
1if the record was stored to the database.0if 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 anINSERTstatement.- Returns:
1if the record was stored to the database.0if storing was not necessary.- Throws:
DataAccessException- if something went wrong executing the query- See Also:
-
insert
Store parts of this record to the database using anINSERTstatement.- Returns:
1if the record was stored to the database.0if storing was not necessary.- Throws:
DataAccessException- if something went wrong executing the query- See Also:
-
fetchParent
@Nullable @Support @Blocking <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
JOINmechanisms 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:
-
parent
Get a table expression representing the parent of this record, given a foreign key.
-