Module is.codion.framework.model
Package is.codion.framework.model
Interface EditorLink.Builder.ForeignKeyNameStep<R extends EntityEditor<R>>
- Type Parameters:
R- theEntityEditortype
- Enclosing interface:
EditorLink.Builder<R extends EntityEditor<R>>
public static interface EditorLink.Builder.ForeignKeyNameStep<R extends EntityEditor<R>>
The second step — choose whether the link is foreign-key based or named.
-
Method Summary
Modifier and TypeMethodDescriptionforeignKey(ForeignKey foreignKey) Creates aForeignKeyEditorLinkbacked by the given foreign key.Begins a non-FK link with the given name.
-
Method Details
-
foreignKey
Creates a
ForeignKeyEditorLinkbacked by the given foreign key.conditiondefaults toforeignKey::equalToandbeforeInsertdefaults to setting the foreign key on the detail to the inserted master. The link name defaults toforeignKey.name(). Any of these can be overridden via the fluent builder methods.- Parameters:
foreignKey- the foreign key on the detail entity, pointing to the master- Returns:
- a builder for further configuration
- Throws:
IllegalArgumentException- if the foreign key's referenced or owning entity types don't match the master and detail editors respectively (validated atregistration time)
-
name
Begins a non-FK link with the given name.
One of
EditorLink.Builder.LoadStep.condition(DetailCondition),EditorLink.Builder.LoadStep.select(DetailSelect)orEditorLink.Builder.LoadStep.entity(DetailEntity)must be supplied next; the user also typically supplies aEditorLink.Builder.beforeInsert(BeforeInsert)that ensures inserted rows are reachable by the supplied load source.- Parameters:
name- the link name, unique within the master's detail editors- Returns:
- a step requiring a load source
- Throws:
IllegalArgumentException- if the name is null or empty
-