Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityModel<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
- All Known Implementing Classes:
DefaultEntityModel
,SwingEntityModel
public interface EntityModel<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
Specifies a class responsible for, among other things, coordinating a
EntityEditModel
and an EntityTableModel
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
EntityModel.DetailModels<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>> Manages the detail models for aEntityModel
-
Method Summary
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the type of the entity this entity model is based on
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the connection provider used by this entity model
-
connection
EntityConnection connection()Do not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.- Returns:
- the connection used by this entity model
-
entities
Entities entities()- Returns:
- the underlying domain entities
-
entityDefinition
EntityDefinition entityDefinition()- Returns:
- the definition of the underlying entity
-
editModel
- Type Parameters:
C
- the edit model type- Returns:
- the
EntityEditModel
instance used by thisEntityModel
-
tableModel
- Type Parameters:
C
- the table model type- Returns:
- the
EntityTableModel
- Throws:
IllegalStateException
- in case no table model is available
-
containsTableModel
boolean containsTableModel()- Returns:
- true if this
EntityModel
contains aEntityTableModel
-
detailModels
EntityModel.DetailModels<M,E, detailModels()T> - Returns:
- the detail models
-