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 Details

    • get

      Collection<M> get()
      Returns:
      an unmodifiable collection containing the detail models this model contains
    • linked

      Returns:
      detail models with an active link to this model, that is, those that should respond to master model events
      See Also:
    • add

      void add(M... detailModels)
      Adds the given detail model to this model, a side effect if the detail model contains a table model is that it is configured so that a query condition is required for it to show any data, via EntityQueryModel.conditionRequired(). Note that each detail model is associated with the first foreign key found referencing this models entity.
      Parameters:
      detailModels - the detail models to add
      Throws:
      IllegalArgumentException - in case no foreign key exists between the entities involved
    • add

      ForeignKeyDetailModelLink<M,E,T> add(M detailModel)
      Adds the given detail model to this model, a side effect if the detail model contains a table model is that it is configured so that a query condition is required for it to show any data, via EntityQueryModel.conditionRequired(). Note that the detail model is associated with the first foreign key found referencing this models entity.
      Parameters:
      detailModel - the detail model
      Returns:
      the resulting ForeignKeyDetailModelLink
      Throws:
      IllegalArgumentException - in case no foreign key exists between the entities involved
    • add

      ForeignKeyDetailModelLink<M,E,T> add(M detailModel, ForeignKey foreignKey)
      Adds the given detail model to this model, a side effect if the detail model contains a table model is that it is configured so that a query condition is required for it to show any data, via EntityQueryModel.conditionRequired() Specify the foreign key in case the detail model is based on an entity which contains multiple foreign keys to the same master entity.
      Parameters:
      detailModel - the detail model
      foreignKey - the foreign key to base the detail model on
      Returns:
      the resulting ForeignKeyDetailModelLink
    • add

      <L extends DetailModelLink<M, E, T>> L add(L detailModelLink)
      Adds the given detail model to this model, a side effect if the detail model contains a table model is that it is configured so that a query condition is required for it to show any data, via EntityQueryModel.conditionRequired()
      Type Parameters:
      L - the DetailModelLink type
      Parameters:
      detailModelLink - the DetailModelLink to add
      Returns:
      the DetailModelLink
      Throws:
      IllegalArgumentException - in case the model has already been added
    • contains

      boolean contains(Class<? extends M> modelClass)
      Parameters:
      modelClass - the detail model class
      Returns:
      true if this model contains a detail model of the given class
    • contains

      boolean contains(EntityType entityType)
      Parameters:
      entityType - the entityType
      Returns:
      true if this model contains a detail model for the given entityType
    • 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

      <C extends M> C get(EntityType entityType)
      Returns a detail model of the given type
      Type Parameters:
      C - the detail model 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
    • link

      <L extends DetailModelLink<M, E, T>> L link(M detailModel)
      Type Parameters:
      L - the DetailModelLink type
      Parameters:
      detailModel - the detail model
      Returns:
      the link for the given detail model
      Throws:
      IllegalArgumentException - in case this model does not contain the given detail model