Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor<M,E,T,R>>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltypeR- theEntityEditortype
- All Known Implementing Classes:
DefaultEntityModel,SwingEntityModel
public interface EntityModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor<M,E,T,R>>
Specifies a class responsible for, among other things, coordinating a
EntityEditModel and an EntityTableModel.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceEntityModel.DetailModels<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<M, E, T, R>> 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
E editModel()- Returns:
- the
EntityEditModelinstance used by thisEntityModel
-
tableModel
T tableModel()- Returns:
- the
EntityTableModel - Throws:
IllegalStateException- in case no table model is available
-
containsTableModel
boolean containsTableModel()- Returns:
- true if this
EntityModelcontains aEntityTableModel
-
link
<B extends ForeignKeyModelLink.Builder<M,E, ForeignKeyModelLink.Builder<M,T, R, B>> E, linkT, R, B> (M model) - Type Parameters:
B- the builder type- Parameters:
model- the model to link to- Returns:
- a
ForeignKeyModelLink.Builder, based on a fitting foreign key - Throws:
IllegalArgumentException- in case zero or multiple fitting foreign keys are found
-
detailModels
EntityModel.DetailModels<M,E, detailModels()T, R> - Returns:
- the detail models
-