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- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltype
- All Known Subinterfaces:
ForeignKeyDetailModelLink<M,E, T>
- All Known Implementing Classes:
DefaultDetailModelLink,DefaultForeignKeyDetailModelLink
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 TypeMethodDescriptionis.codion.common.state.Stateactive()Controls the active status of this link.default voidonDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities) Called when delete is performed in the master model, regardless of entity type.default voidonInsert(Collection<is.codion.framework.domain.entity.Entity> insertedEntities) Called when a insert is performed in the master model, regardless of entity type.default voidonSelection(Collection<is.codion.framework.domain.entity.Entity> selectedEntities) Called when the selection changes in the master modeldefault voidonUpdate(Map<is.codion.framework.domain.entity.Entity.Key, is.codion.framework.domain.entity.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
is.codion.common.state.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
default void onUpdate(Map<is.codion.framework.domain.entity.Entity.Key, is.codion.framework.domain.entity.Entity> updatedEntities) 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
-