R
- The FOREIGN KEY
's owner table recordO
- The referenced KEY
's owner table recordpublic interface ForeignKey<R extends Record,O extends Record> extends Key<R>
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.
Modifier and Type | Method and Description |
---|---|
@NotNull Table<R> |
children(Collection<? extends O> records)
Get a table expression representing the children of a record, given this
foreign key.
|
@NotNull Table<R> |
children(O... records)
Get a table expression representing the children of a record, given this
foreign key.
|
@NotNull Table<R> |
children(O record)
Get a table expression representing the children of a record, given this
foreign key.
|
@NotNull Result<R> |
fetchChildren(Collection<? extends O> records)
Fetch child records of a given set of records through this foreign key
This returns childs record referencing any record in a given set of
records through this foreign key, as if fetching from
children(Collection) . |
@NotNull Result<R> |
fetchChildren(O... records)
Fetch child records of a given set of records through this foreign key
This returns childs record referencing any record in a given set of
records through this foreign key, as if fetching from
children(Record...) . |
@NotNull Result<R> |
fetchChildren(O record)
Fetch child records of a given record through this foreign key
This returns childs record referencing a given record through this
foreign key, as if fetching from
children(Record) . |
O |
fetchParent(R record)
Fetch a parent record of a given record through this foreign key
This returns a parent record referenced by a given record through this
foreign key, as if fetching from
parent(Record) . |
@NotNull Result<O> |
fetchParents(Collection<? extends R> records)
Fetch parent records of a given set of record through this foreign key
This returns parent records referenced by any record in a given set of
records through this foreign key, as if fetching from
parents(Collection) . |
@NotNull Result<O> |
fetchParents(R... records)
Fetch parent records of a given set of record through this foreign key
This returns parent records referenced by any record in a given set of
records through this foreign key, as if fetching from
parents(Record...) . |
@NotNull UniqueKey<O> |
getKey()
The referenced
UniqueKey . |
@NotNull List<TableField<O,?>> |
getKeyFields()
The fields that make up the referenced
UniqueKey . |
@NotNull TableField<O,?>[] |
getKeyFieldsArray()
The fields that make up the referenced
UniqueKey . |
@NotNull Table<O> |
parent(R record)
Get a table expression representing the parent of a record, given this
foreign key.
|
@NotNull Table<O> |
parents(Collection<? extends R> records)
Get a table expression representing the parents of a record, given this
foreign key.
|
@NotNull Table<O> |
parents(R... records)
Get a table expression representing the parents of a record, given this
foreign key.
|
constraint, enforced, getFields, getFieldsArray, getTable, nullable
getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
@NotNull @NotNull List<TableField<O,?>> getKeyFields()
UniqueKey
.
This returns the order in which the fields of getKey()
are
referenced, which is usually the same as the fields of
Key.getFields()
, but not necessarily so.
@NotNull @NotNull TableField<O,?>[] getKeyFieldsArray()
UniqueKey
.
This returns the order in which the fields of getKey()
are
referenced, which is usually the same as the fields of
Key.getFieldsArray()
, but not necessarily so.
getKeyFields()
@Nullable O fetchParent(R record) throws DataAccessException
This 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 returns null
DataAccessException
- if something went wrong executing the queryTableRecord.fetchParent(ForeignKey)
@NotNull @NotNull Result<O> fetchParents(R... records) throws DataAccessException
This returns parent records referenced by any record in a given set of
records through this foreign key, as if fetching from
parents(Record...)
.
DataAccessException
- if something went wrong executing the queryTableRecord.fetchParent(ForeignKey)
@NotNull @NotNull Result<O> fetchParents(Collection<? extends R> records) throws DataAccessException
This returns parent records referenced by any record in a given set of
records through this foreign key, as if fetching from
parents(Collection)
.
DataAccessException
- if something went wrong executing the queryTableRecord.fetchParent(ForeignKey)
@NotNull @NotNull Result<R> fetchChildren(O record) throws DataAccessException
This returns childs record referencing a given record through this
foreign key, as if fetching from children(Record)
.
DataAccessException
- if something went wrong executing the queryUpdatableRecord.fetchChild(ForeignKey)
,
UpdatableRecord.fetchChildren(ForeignKey)
@NotNull @NotNull Result<R> fetchChildren(O... records) throws DataAccessException
This returns childs record referencing any record in a given set of
records through this foreign key, as if fetching from
children(Record...)
.
DataAccessException
- if something went wrong executing the queryUpdatableRecord.fetchChild(ForeignKey)
,
UpdatableRecord.fetchChildren(ForeignKey)
@NotNull @NotNull Result<R> fetchChildren(Collection<? extends O> records) throws DataAccessException
This returns childs record referencing any record in a given set of
records through this foreign key, as if fetching from
children(Collection)
.
DataAccessException
- if something went wrong executing the queryUpdatableRecord.fetchChild(ForeignKey)
,
UpdatableRecord.fetchChildren(ForeignKey)
@NotNull @NotNull Table<O> parent(R record)
@NotNull @NotNull Table<O> parents(R... records)
@NotNull @NotNull Table<O> parents(Collection<? extends R> records)
@NotNull @NotNull Table<R> children(O record)
@NotNull @NotNull Table<R> children(O... records)
@NotNull @NotNull Table<R> children(Collection<? extends O> records)
Copyright © 2021. All rights reserved.