Interface ModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>

Type Parameters:
M - the EntityModel type
E - the EntityEditModel type
T - the EntityTableModel type
All Known Subinterfaces:
ForeignKeyModelLink<M,E,T>

public interface ModelLink<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
Represents a link between two entity models.
See Also:
  • Method Details

    • model

      M model()
      Returns:
      the linked model
    • active

      State active()

      Controls the active status of this link.

      Active model links respond to the parent model selection via onSelection(Collection).

      Returns:
      the State controlling the active status of this model link
      See Also:
    • onSelection

      void onSelection(Collection<Entity> selectedEntities)

      Called when the selection changes in the parent model or when this link is activated.

      Note that only active links are required to handle parent model selection.

      Parameters:
      selectedEntities - the selected entities
      See Also:
    • onInsert

      void onInsert(Collection<Entity> insertedEntities)
      Called when a insert is performed in the parent model, regardless of entity type.
      Parameters:
      insertedEntities - the inserted entities
    • onUpdate

      void onUpdate(Map<Entity,Entity> updatedEntities)
      Called when an update is performed in the parent model, regardless of entity type.
      Parameters:
      updatedEntities - the updated entities, mapped to their state before the update
    • onDelete

      void onDelete(Collection<Entity> deletedEntities)
      Called when delete is performed in the parent model, regardless of entity type.
      Parameters:
      deletedEntities - the deleted entities
    • builder

      static <M extends EntityModel<M, E, T>, E extends EntityEditModel, T extends EntityTableModel<E>, B extends ModelLink.Builder<M, E, T, B>> ModelLink.Builder<M,E,T,B> builder(M model)

      Returns a new ModelLink.Builder instance.

      Note that if the linked model contains a table model it is configured so that a query condition is required for it to show any data, via EntityQueryModel.conditionRequired()

      Type Parameters:
      M - the EntityModel type
      E - the EntityEditModel type
      T - the EntityTableModel type
      B - the builder type
      Parameters:
      model - the model to link
      Returns:
      a ModelLink.Builder instance