Top Description Methods
org.jooq

public Interface TableRecord<R extends org.jooq.TableRecord<R>>

extends QualifiedRecord<R extends TableRecord<R>>
Known Direct Subinterfaces
org.jooq.UpdatableRecord
Known Direct Implementers
org.jooq.impl.TableRecordImpl
Type Parameters
<R>
The record type
Imports
java.util.Collection, org.jooq.conf.Settings, org.jooq.exception.DataAccessException, org.jetbrains.annotations.Blocking, .NotNull, .Nullable

A record originating from a single table
Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public <O extends UpdatableRecord<O>> O
fetchParent(ForeignKey<R, O> key)

Fetch a parent record of this record, given a foreign key.

public @NotNull Table<R>
getTable()

The table from which this record was read.

public int

Returns:

1 if the record was stored to the database. 0 if storing was not necessary and Settings#isInsertUnchangedRecords() is set to false.
insert
()

Store this record to the database using an INSERT statement.

public int

Returns:

1 if the record was stored to the database. 0 if storing was not necessary.
insert
(Field<?>... fields)

Deprecated as a consequence of Field being deprecated.
Store parts of this record to the database using an INSERT statement.
public int

Returns:

1 if the record was stored to the database. 0 if storing was not necessary.
insert
(Collection<? extends Field<?>> fields)

Store parts of this record to the database using an INSERT statement.

public R
original()

Redeclares org.jooq.Record.original.

Get this record containing the original values as fetched from the database.
public <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.

Inherited from org.jooq.QualifiedRecord:
getQualifierwithwith

Method Detail

fetchParentback to summary
public <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 returns null.

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/.

Annotations
@Nullable
@Support
@Blocking
Exceptions
DataAccessException:
if something went wrong executing the query
See Also
ForeignKey#fetchParent(Record), ForeignKey#fetchParents(java.util.Collection), ForeignKey#fetchParents(Record...)
getTableback to summary
public @NotNull Table<R> getTable()

The table from which this record was read.

Annotations
@NotNull
insertback to summary
public int insert() throws DataAccessException

Store this record to the database using an INSERT 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 changed(boolean) or for single values with changed(Field, boolean), prior to insertion.

Returns:int

1 if the record was stored to the database. 0 if storing was not necessary and Settings#isInsertUnchangedRecords() is set to false.

Annotations
@Support
Exceptions
DataAccessException:
if something went wrong executing the query
insertback to summary
public int insert(Field<?>... fields) throws DataAccessException

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Store parts of this record to the database using an INSERT statement.

Returns:int

1 if the record was stored to the database. 0 if storing was not necessary.

Annotations
@Support
Exceptions
DataAccessException:
if something went wrong executing the query
See Also
insert()
insertback to summary
public int insert(Collection<? extends Field<?>> fields) throws DataAccessException

Store parts of this record to the database using an INSERT statement.

Returns:int

1 if the record was stored to the database. 0 if storing was not necessary.

Annotations
@Support
Exceptions
DataAccessException:
if something went wrong executing the query
See Also
insert()
originalback to summary
public R original()

Redeclares org.jooq.Record.original.

Doc from org.jooq.Record.original.

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.

Annotations
@NotNull
@Override
parentback to summary
public <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.

Annotations
@NotNull
@Support