Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityModel.DetailModels<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
- Type Parameters:
M
- the type ofEntityModel
used for detail modelsE
- the type ofEntityEditModel
used by thisEntityModel
T
- the type ofEntityTableModel
used by thisEntityModel
- 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 TypeMethodDescription<L extends DetailModelLink<M,
E, T>>
Ladd
(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, viaEntityQueryModel.conditionRequired()
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, viaEntityQueryModel.conditionRequired()
.void
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, viaEntityQueryModel.conditionRequired()
.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, viaEntityQueryModel.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.boolean
contains
(EntityType entityType) boolean
boolean
get()
<C extends M>
Cget
(EntityType entityType) Returns a detail model of the given type<C extends M>
CReturns the first detail model of the given type<L extends DetailModelLink<M,
E, T>>
Llinked()
-
Method Details
-
get
Collection<M> get()- Returns:
- an unmodifiable collection containing the detail models this model contains
-
linked
ObservableValueSet<M> linked()- Returns:
- detail models with an active link to this model, that is, those that should respond to master model events
- See Also:
-
add
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, viaEntityQueryModel.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
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, viaEntityQueryModel.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
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, viaEntityQueryModel.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 modelforeignKey
- the foreign key to base the detail model on- Returns:
- the resulting
ForeignKeyDetailModelLink
-
add
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, viaEntityQueryModel.conditionRequired()
- Type Parameters:
L
- theDetailModelLink
type- Parameters:
detailModelLink
- theDetailModelLink
to add- Returns:
- the
DetailModelLink
- Throws:
IllegalArgumentException
- in case the model has already been added
-
contains
- Parameters:
modelClass
- the detail model class- Returns:
- true if this model contains a detail model of the given class
-
contains
- Parameters:
entityType
- the entityType- Returns:
- true if this model contains a detail model for the given entityType
-
contains
- Parameters:
detailModel
- the detail model- Returns:
- true if this model contains the given detail model
-
get
Returns the first detail model of the given type- Type Parameters:
C
- the model type- Parameters:
modelClass
- the type of the requiredEntityModel
- Returns:
- the detail model of type
entityModelClass
- Throws:
IllegalArgumentException
- in case this model does not contain a detail model of the given type
-
get
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
- Type Parameters:
L
- theDetailModelLink
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
-