Module is.codion.framework.model
Package is.codion.framework.model
Interface ForeignKeyConditionModel
- All Superinterfaces:
AttributeConditionModel<Entity>,ConditionModel<Entity>
A foreign key condition model, the operands being entities of the referenced type.
The operand components are based on the models provided by models(), a combo box model and
a search model per operand, each created on first access. The operands are plain values, independent of
these models, a component based on one must be linked to the operand it edits, ConditionModel.Operands.equal()
or ConditionModel.Operands.in(). Entities of the referenced type updated or deleted are replaced in, or removed
from, the operands, via PersistenceEvents.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for aForeignKeyConditionModel.static interfaceA link to a master condition.static interfaceProvides the models the operand components are based on, each created on first access.Nested classes/interfaces inherited from interface is.codion.common.model.condition.ConditionModel
ConditionModel.Operands<T>, ConditionModel.SetCondition<T>, ConditionModel.Wildcard -
Field Summary
Fields inherited from interface is.codion.common.model.condition.ConditionModel
AUTO_ENABLE, CASE_SENSITIVE, WILDCARD, WILDCARD_CHARACTER -
Method Summary
Modifier and TypeMethodDescriptionbuilder()link(ForeignKeyConditionModel master) Links this condition to the given master condition, the referenced entity having exactly one foreign key referencing the referenced entity type of the master condition.link(ForeignKeyConditionModel master, ForeignKey foreignKey) Links this condition to the given master condition, the referenced entities offered by themodels()restricted to those referring, via the given foreign key of the referenced entity, to the entities the master condition refers to, the EQUAL operand or the IN operands, none when the master condition is disabled or its operator negated.models()Methods inherited from interface is.codion.framework.model.AttributeConditionModel
accepts, autoEnable, caseSensitive, clear, condition, dateTimePattern, enabled, format, locked, operands, operator, operators, set, valueClassMethods inherited from interface is.codion.common.model.condition.ConditionModel
caption, changed
-
Method Details
-
attribute
ForeignKey attribute()- Specified by:
attributein interfaceAttributeConditionModel<Entity>- Returns:
- the attribute
-
models
ForeignKeyConditionModel.Models models()- Returns:
- the models the operand components are based on
-
link
Links this condition to the given master condition, the referenced entities offered by themodels()restricted to those referring, via the given foreign key of the referenced entity, to the entities the master condition refers to, the EQUAL operand or the IN operands, none when the master condition is disabled or its operator negated. The operands of this condition no longer referred to are dropped.- Parameters:
master- the master conditionforeignKey- the foreign key of the referenced entity, referencing the referenced entity type of the master condition- Returns:
- the link, controlling the strictness of the filtering
- Throws:
IllegalArgumentException- in case the given foreign key is not one of the referenced entity or does not reference the referenced entity type of the master condition, or the master condition is this conditionIllegalStateException- in case this condition is already linked on the given foreign key- See Also:
-
link
Links this condition to the given master condition, the referenced entity having exactly one foreign key referencing the referenced entity type of the master condition.- Parameters:
master- the master condition- Returns:
- the link, controlling the strictness of the filtering
- Throws:
IllegalArgumentException- in case the referenced entity has none or several foreign keys referencing the referenced entity type of the master condition, or the master condition is this conditionIllegalStateException- in case this condition is already linked on the foreign key- See Also:
-
builder
- Returns:
- a new
ForeignKeyConditionModel.Builder.ForeignKeyStep
-