Module is.codion.framework.model
Package is.codion.framework.model
Interface DetailModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
- Type Parameters:
M
- theEntityModel
typeE
- theEntityEditModel
typeT
- theEntityTableModel
type
- All Known Subinterfaces:
ForeignKeyDetailModelLink<M,
E, T>
- All Known Implementing Classes:
DefaultDetailModelLink
,DefaultForeignKeyDetailModelLink
,SwingDetailModelLink
,SwingForeignKeyDetailModelLink
public interface DetailModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
Represents a link between a master and detail model.
-
Method Summary
Modifier and TypeMethodDescriptionactive()
Controls the active status of this link.default void
onDelete
(Collection<Entity> deletedEntities) Called when delete is performed in the master model, regardless of entity type.default void
onInsert
(Collection<Entity> insertedEntities) Called when a insert is performed in the master model, regardless of entity type.default void
onSelection
(Collection<Entity> selectedEntities) Called when the selection changes in the master modeldefault void
onUpdate
(Map<Entity.Key, Entity> updatedEntities) Called when an update is performed in the master model, regardless of entity type.
-
Method Details
-
detailModel
M detailModel()- Returns:
- the detail model
-
active
State active()Controls the active status of this link. Active detail model links update and filter the detail model according to the entity/entities selected in the master model.- Returns:
- the
State
controlling the active status of this detail model link
-
onSelection
Called when the selection changes in the master model- Parameters:
selectedEntities
- the selected master entities
-
onInsert
Called when a insert is performed in the master model, regardless of entity type.- Parameters:
insertedEntities
- the inserted entities
-
onUpdate
Called when an update is performed in the master model, regardless of entity type.- Parameters:
updatedEntities
- the updated entities, mapped to their original primary keys
-
onDelete
Called when delete is performed in the master model, regardless of entity type.- Parameters:
deletedEntities
- the deleted entities
-