- Type Parameters:
CHILD
- TheFOREIGN KEY
's owner table recordPARENT
- The referencedKEY
's owner table record
- All Superinterfaces:
Key<CHILD>
,Named
,QueryPart
,Serializable
ForeignKey
is an object referencing a UniqueKey
. It
represents a FOREIGN KEY
relationship between two tables.
Instances of this type cannot be created directly. They are available from generated code.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionchildren
(Collection<? extends PARENT> records) Get a table expression representing the children of a record, given this foreign key.Get a table expression representing the children of a record, given this foreign key.Get a table expression representing the children of a record, given this foreign key.fetchChildren
(Collection<? extends PARENT> records) Fetch child records of a given set of records through this foreign keyfetchChildren
(PARENT record) Fetch child records of a given record through this foreign keyfetchChildren
(PARENT... records) Fetch child records of a given set of records through this foreign keyfetchParent
(CHILD record) Fetch a parent record of a given record through this foreign keyfetchParents
(CHILD... records) Fetch parent records of a given set of record through this foreign keyfetchParents
(Collection<? extends CHILD> records) Fetch parent records of a given set of record through this foreign key@Nullable QOM.ForeignKeyRule
The foreign key'sON DELETE
rule, ornull
if it's not specified, which defaults toQOM.ForeignKeyRule.NO_ACTION
.@NotNull InverseForeignKey
<PARENT, CHILD> The inverse key.getKey()
The referencedUniqueKey
.@NotNull List
<TableField<PARENT, ?>> The fields that make up the referencedUniqueKey
.@NotNull TableField<PARENT,
?> @NotNull [] The fields that make up the referencedUniqueKey
.@Nullable QOM.ForeignKeyRule
The foreign key'sON UPDATE
rule, ornull
if it's not specified, which defaults toQOM.ForeignKeyRule.NO_ACTION
.Get a table expression representing the parent of a record, given this foreign key.Get a table expression representing the parents of a record, given this foreign key.parents
(Collection<? extends CHILD> records) Get a table expression representing the parents of a record, given this foreign key.Methods inherited from interface org.jooq.Key
constraint, enforced, getFields, getFieldsArray, getTable, nullable
Methods inherited from interface org.jooq.Named
$name, getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
-
Method Details
-
getDeleteRule
The foreign key'sON DELETE
rule, ornull
if it's not specified, which defaults toQOM.ForeignKeyRule.NO_ACTION
. -
getUpdateRule
The foreign key'sON UPDATE
rule, ornull
if it's not specified, which defaults toQOM.ForeignKeyRule.NO_ACTION
. -
getInverseKey
The inverse key. -
getKey
The referencedUniqueKey
. -
getKeyFields
The fields that make up the referencedUniqueKey
.This returns the order in which the fields of
getKey()
are referenced, which is usually the same as the fields ofKey.getFields()
, but not necessarily so. -
getKeyFieldsArray
The fields that make up the referencedUniqueKey
.This returns the order in which the fields of
getKey()
are referenced, which is usually the same as the fields ofKey.getFieldsArray()
, but not necessarily so.- See Also:
-
fetchParent
Fetch a parent record of a given record through this foreign keyThis returns a parent record referenced by a given record through this foreign key, as if fetching from
parent(Record)
. If no parent record was found, this returnsnull
- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
fetchParents
@NotNull @Blocking @NotNull Result<PARENT> fetchParents(CHILD... records) throws DataAccessException Fetch parent records of a given set of record through this foreign keyThis returns parent records referenced by any record in a given set of records through this foreign key, as if fetching from
parents(Record...)
.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
fetchParents
@NotNull @Blocking @NotNull Result<PARENT> fetchParents(Collection<? extends CHILD> records) throws DataAccessException Fetch parent records of a given set of record through this foreign keyThis returns parent records referenced by any record in a given set of records through this foreign key, as if fetching from
parents(Collection)
.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
fetchChildren
Fetch child records of a given record through this foreign keyThis returns childs record referencing a given record through this foreign key, as if fetching from
children(Record)
.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
fetchChildren
@NotNull @Blocking @NotNull Result<CHILD> fetchChildren(PARENT... records) throws DataAccessException Fetch child records of a given set of records through this foreign keyThis returns childs record referencing any record in a given set of records through this foreign key, as if fetching from
children(Record...)
.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
fetchChildren
@NotNull @Blocking @NotNull Result<CHILD> fetchChildren(Collection<? extends PARENT> records) throws DataAccessException Fetch child records of a given set of records through this foreign keyThis returns childs record referencing any record in a given set of records through this foreign key, as if fetching from
children(Collection)
.- Throws:
DataAccessException
- if something went wrong executing the query- See Also:
-
parent
Get a table expression representing the parent of a record, given this foreign key. -
parents
Get a table expression representing the parents of a record, given this foreign key. -
parents
Get a table expression representing the parents of a record, given this foreign key. -
children
Get a table expression representing the children of a record, given this foreign key. -
children
Get a table expression representing the children of a record, given this foreign key. -
children
Get a table expression representing the children of a record, given this foreign key.
-