-
- Type Parameters:
R
- The record type
- All Superinterfaces:
Attachable
,Comparable<Record>
,Formattable
,Record
,Serializable
- All Known Subinterfaces:
UpdatableRecord<R>
- All Known Implementing Classes:
CustomRecord
,TableRecordImpl
,UpdatableRecordImpl
public interface TableRecord<R extends TableRecord<R>> extends Record
A record originating from a single table- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <O extends UpdatableRecord<O>>
OfetchParent(ForeignKey<R,O> key)
Fetch a parent record of this record, given a foreign key.@NotNull Table<R>
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
insert(Field<?>... fields)
Store parts of this record to the database using anINSERT
statement.R
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.<T> R
with(Field<T> field, T value)
Set a value into this record.<T,U>
Rwith(Field<T> field, U value, Converter<? extends T,? super U> converter)
Set a value into this record.-
Methods inherited from interface org.jooq.Attachable
attach, configuration, detach
-
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.Record
changed, changed, changed, changed, changed, changed, changed, changed, changed, changed, compareTo, equals, field, field, field, field, fields, fields, fields, fields, fields, fieldsRow, 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, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, hashCode, indexOf, indexOf, indexOf, 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
-
-
-
-
Method Detail
-
original
@NotNull R 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
@Support int insert() throws DataAccessException
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
@Support int insert(Field<?>... fields) throws DataAccessException
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
@Support int insert(Collection<? extends Field<?>> fields) throws DataAccessException
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 DataAccessException
Fetch 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
- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
ForeignKey.fetchParent(Record)
,ForeignKey.fetchParents(java.util.Collection)
,ForeignKey.fetchParents(Record...)
-
parent
@NotNull @Support <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.
-
with
@NotNull <T> R with(Field<T> field, T value)
Description copied from interface:Record
Set a value into this record.Like
Record.set(Field, Object)
but returningthis
for fluent setting of multiple values.
-
with
@NotNull <T,U> R with(Field<T> field, U value, Converter<? extends T,? super U> converter)
Description copied from interface:Record
Set a value into this record.Like
Record.set(Field, Object, Converter)
but returningthis
for fluent setting of multiple values.
-
-