- Type Parameters:
R
- TheFOREIGN KEY
's owner table recordO
- The referencedKEY
's owner table record
- All Superinterfaces:
Key<R>
,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 O> 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 O> records)
Fetch child records of a given set of records through this foreign keyfetchChildren(O record)
Fetch child records of a given record through this foreign keyfetchChildren(O... records)
Fetch child records of a given set of records through this foreign keyfetchParent(R record)
Fetch a parent record of a given record through this foreign keyfetchParents(Collection<? extends R> records)
Fetch parent records of a given set of record through this foreign keyfetchParents(R... records)
Fetch parent records of a given set of record through this foreign keygetKey()
The referencedUniqueKey
.@NotNull List<TableField<O,?>>
The fields that make up the referencedUniqueKey
.@NotNull TableField<O,?>[]
The fields that make up the referencedUniqueKey
.Get a table expression representing the parent of a record, given this foreign key.parents(Collection<? extends R> records)
Get a table expression representing the parents of a record, given this foreign key.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
getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
-
Method Details
-
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:
getKeyFields()
-
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:
TableRecord.fetchParent(ForeignKey)
-
fetchParents
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:
TableRecord.fetchParent(ForeignKey)
-
fetchParents
@NotNull @NotNull Result<O> fetchParents(Collection<? extends R> records) throws DataAccessExceptionFetch 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:
TableRecord.fetchParent(ForeignKey)
-
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:
UpdatableRecord.fetchChild(ForeignKey)
,UpdatableRecord.fetchChildren(ForeignKey)
-
fetchChildren
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:
UpdatableRecord.fetchChild(ForeignKey)
,UpdatableRecord.fetchChildren(ForeignKey)
-
fetchChildren
@NotNull @NotNull Result<R> fetchChildren(Collection<? extends O> records) throws DataAccessExceptionFetch 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:
UpdatableRecord.fetchChild(ForeignKey)
,UpdatableRecord.fetchChildren(ForeignKey)
-
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.
-