Module is.codion.framework.model
Package is.codion.framework.model
Class DefaultEntityModel<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
java.lang.Object
is.codion.framework.model.DefaultEntityModel<M,E,T>
- Type Parameters:
M
- the type ofDefaultEntityModel
used for detail modelsE
- the type ofAbstractEntityEditModel
used by thisEntityModel
T
- the type ofEntityTableModel
used by thisEntityModel
- All Implemented Interfaces:
EntityModel<M,
E, T>
- Direct Known Subclasses:
SwingEntityModel
public class DefaultEntityModel<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
extends Object
implements EntityModel<M,E,T>
A default EntityModel implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.framework.model.EntityModel
EntityModel.DetailModels<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>> -
Constructor Summary
ConstructorDescriptionDefaultEntityModel
(E editModel) Instantiates a new DefaultEntityModel, without a table modelDefaultEntityModel
(T tableModel) Instantiates a new DefaultEntityModel -
Method Summary
Modifier and TypeMethodDescriptionfinal EntityConnection
Do not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.final EntityConnectionProvider
final boolean
final EntityModel.DetailModels<M,
E, T> final <C extends E>
Cfinal Entities
entities()
final EntityDefinition
final EntityType
final <C extends T>
Cfinal String
toString()
-
Constructor Details
-
DefaultEntityModel
Instantiates a new DefaultEntityModel, without a table model- Parameters:
editModel
- the edit model
-
DefaultEntityModel
Instantiates a new DefaultEntityModel- Parameters:
tableModel
- the table model
-
-
Method Details
-
toString
-
entityType
- Specified by:
entityType
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the type of the entity this entity model is based on
-
connectionProvider
- Specified by:
connectionProvider
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the connection provider used by this entity model
-
connection
Description copied from interface:EntityModel
Do not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.- Specified by:
connection
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the connection used by this entity model
-
entities
- Specified by:
entities
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the underlying domain entities
-
entityDefinition
- Specified by:
entityDefinition
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the definition of the underlying entity
-
editModel
- Specified by:
editModel
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Type Parameters:
C
- the edit model type- Returns:
- the
EntityEditModel
instance used by thisEntityModel
-
tableModel
- Specified by:
tableModel
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Type Parameters:
C
- the table model type- Returns:
- the
EntityTableModel
-
containsTableModel
public final boolean containsTableModel()- Specified by:
containsTableModel
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- true if this
EntityModel
contains aEntityTableModel
-
detailModels
- Specified by:
detailModels
in interfaceEntityModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the detail models
-