Module is.codion.framework.model
Package is.codion.framework.model
Interface ForeignKeyModelLink.Builder<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>,B extends ForeignKeyModelLink.Builder<M,E,T,B>>
- Type Parameters:
M
- theEntityModel
typeE
- theEntityEditModel
typeT
- theEntityTableModel
typeB
- the builder type
- All Superinterfaces:
ModelLink.Builder<M,
E, T, B>
- Enclosing interface:
ForeignKeyModelLink<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>>
public static interface ForeignKeyModelLink.Builder<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>,B extends ForeignKeyModelLink.Builder<M,E,T,B>>
extends ModelLink.Builder<M,E,T,B>
Builds a
ForeignKeyModelLink
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
clearConditionOnEmptySelection
(boolean clearConditionOnEmptySelection) clearValueOnEmptySelection
(boolean clearValueOnEmptySelection) onInsert
(Consumer<Collection<Entity>> onInsert) Note that this overridessetValueOnInsert(boolean)
onSelection
(Consumer<Collection<Entity>> onSelection) Note that this overridesrefreshOnSelection(boolean)
,clearConditionOnEmptySelection(boolean)
andclearValueOnEmptySelection(boolean)
Note that only active model links respond to parent model selection by default.refreshOnSelection
(boolean refreshOnSelection) Note that only active model links respond to parent model selection by default.setConditionOnInsert
(boolean setConditionOnInsert) setValueOnInsert
(boolean setValueOnInsert) Methods inherited from interface is.codion.framework.model.ModelLink.Builder
active, onDelete, onUpdate
-
Method Details
-
onSelection
Note that this overrides
refreshOnSelection(boolean)
,clearConditionOnEmptySelection(boolean)
andclearValueOnEmptySelection(boolean)
Note that only active model links respond to parent model selection by default.- Specified by:
onSelection
in interfaceModelLink.Builder<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>, B extends ForeignKeyModelLink.Builder<M, E, T, B>> - Parameters:
onSelection
- called when the selection changes in the parent model- Returns:
- this builder
- See Also:
-
onInsert
Note that this overrides
setValueOnInsert(boolean)
- Specified by:
onInsert
in interfaceModelLink.Builder<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>, B extends ForeignKeyModelLink.Builder<M, E, T, B>> - Parameters:
onInsert
- called when an insert is performed in the parent model- Returns:
- this builder
-
setConditionOnInsert
- Parameters:
setConditionOnInsert
- specifies whether the linked table model should automatically search by the inserted entity when an insert is performed in a parent model- Returns:
- this builder
- See Also:
-
setValueOnInsert
- Parameters:
setValueOnInsert
- specifies whether the linked edit model should automatically set the foreign key value to the inserted entity- Returns:
- this builder
- See Also:
-
refreshOnSelection
Note that only active model links respond to parent model selection by default.- Parameters:
refreshOnSelection
- specifies whether the linked table model should be automatically refreshed when the foreign key condition is set according to the parent model selection- Returns:
- this builder
- See Also:
-
clearValueOnEmptySelection
- Parameters:
clearValueOnEmptySelection
- specifies whether the linked model should set the foreign key to null when null or no value is selected in the parent model.- Returns:
- this builder
- See Also:
-
clearConditionOnEmptySelection
- Parameters:
clearConditionOnEmptySelection
- specifies whether the linked table model should clear the foreign key search condition when no value is selected in the parent model- Returns:
- this builder
- See Also:
-
build
ForeignKeyModelLink<M,E, build()T> - Specified by:
build
in interfaceModelLink.Builder<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>, B extends ForeignKeyModelLink.Builder<M, E, T, B>> - Returns:
- a
ForeignKeyModelLink
-