Interface EntityModel.DetailModels<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>

Type Parameters:
M - the type of EntityModel used for detail models
E - the type of EntityEditModel used by this EntityModel
T - the type of EntityTableModel used by this EntityModel
Enclosing interface:
EntityModel<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>

public static interface EntityModel.DetailModels<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
Manages the detail models for a EntityModel
  • Method Summary

    Modifier and Type
    Method
    Description
     
    active(M detailModel)
     
    void
    add(ModelLink<M,E,T> modelLink)
    Adds the given detail model to this model.
    void
    add(M detailModel)
    Adds the given detail model to this model, based on a fitting foreign key.
    void
    add(M... detailModels)
    Adds the given detail models to this model, based on a fitting foreign key.
    void
    add(M detailModel, ForeignKey foreignKey)
    Adds the given detail model to this model, based on the given foreign key.
    boolean
    contains(M detailModel)
     
    get()
     
    get(EntityType entityType)
    Returns a detail model of the given type
    <C extends M>
    C
    get(Class<C> modelClass)
    Returns the first detail model of the given type
  • Method Details

    • get

      Map<M,ModelLink<M,E,T>> get()
      Returns:
      an unmodifiable view of the detail models this model contains
    • active

      Returns:
      the active detail models, that is, those that should respond to master model selection events
      See Also:
    • add

      void add(M... detailModels)

      Adds the given detail models to this model, based on a fitting foreign key.

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

      Parameters:
      detailModels - the detail models to add
      Throws:
      IllegalArgumentException - in case zero or multiple fitting foreign keys are found
    • add

      void add(M detailModel)

      Adds the given detail model to this model, based on a fitting foreign key.

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

      Parameters:
      detailModel - the detail model
      Throws:
      IllegalArgumentException - in case zero or multiple fitting foreign keys are found
    • add

      void add(M detailModel, ForeignKey foreignKey)
      Adds the given detail model to this model, based on the given foreign key.

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

      Parameters:
      detailModel - the detail model
      foreignKey - the foreign key to base the detail model link on
    • add

      void add(ModelLink<M,E,T> modelLink)
      Adds the given detail model to this model.
      Parameters:
      modelLink - the ModelLink to add
      Throws:
      IllegalArgumentException - in case the model has already been added
    • contains

      boolean contains(M detailModel)
      Parameters:
      detailModel - the detail model
      Returns:
      true if this model contains the given detail model
    • get

      <C extends M> C get(Class<C> modelClass)
      Returns the first detail model of the given type
      Type Parameters:
      C - the model type
      Parameters:
      modelClass - the type of the required EntityModel
      Returns:
      the detail model of type entityModelClass
      Throws:
      IllegalArgumentException - in case this model does not contain a detail model of the given type
    • get

      M get(EntityType entityType)
      Returns a detail model of the given type
      Parameters:
      entityType - the entityType of the required EntityModel
      Returns:
      the detail model of type entityModelClass
      Throws:
      IllegalArgumentException - in case this model does not contain a detail model for the entityType
    • active

      State active(M detailModel)
      Parameters:
      detailModel - the detail model
      Returns:
      the active State for the given detail model
      Throws:
      IllegalArgumentException - in case this model does not contain the given detail model