Module is.codion.framework.model
Package is.codion.framework.model
Class DefaultEntityModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor<R>>
java.lang.Object
is.codion.framework.model.DefaultEntityModel<M,E,T,R>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltypeR- theEntityEditortype
- All Implemented Interfaces:
EntityModel<M,E, T, R>
- Direct Known Subclasses:
SwingEntityModel
public class DefaultEntityModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<M,E,T,R>,T extends EntityTableModel<M,E,T,R>,R extends EntityEditor<R>>
extends Object
implements EntityModel<M,E,T,R>
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, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEntityModel(E editModel) Instantiates a newDefaultEntityModel, without a table modelDefaultEntityModel(T tableModel) Instantiates a newDefaultEntityModel -
Method Summary
Modifier and TypeMethodDescriptionfinal EntityConnectionDo not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.final EntityConnectionProviderfinal booleanfinal EntityModel.DetailModels<M, E, T, R> detail()final Efinal Reditor()final Entitiesentities()final EntityDefinitionfinal EntityTypefinal Tfinal StringtoString()
-
Constructor Details
-
DefaultEntityModel
Instantiates a newDefaultEntityModel, without a table model- Parameters:
editModel- the edit model
-
DefaultEntityModel
Instantiates a newDefaultEntityModel- Parameters:
tableModel- the table model
-
-
Method Details
-
toString
-
entityType
- Specified by:
entityTypein interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the type of the entity this entity model is based on
-
connectionProvider
- Specified by:
connectionProviderin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the connection provider used by this entity model
-
connection
Description copied from interface:EntityModelDo 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:
connectionin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the connection used by this entity model
-
entities
- Specified by:
entitiesin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the underlying domain entities
-
entityDefinition
- Specified by:
entityDefinitionin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the definition of the underlying entity
-
editModel
- Specified by:
editModelin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the
EntityEditModelinstance used by thisEntityModel
-
editor
- Specified by:
editorin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the
EntityEditorinstance used by thisEntityModel
-
tableModel
- Specified by:
tableModelin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the
EntityTableModel
-
containsTableModel
public final boolean containsTableModel()- Specified by:
containsTableModelin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- true if this
EntityModelcontains aEntityTableModel
-
detail
- Specified by:
detailin interfaceEntityModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<R>> - Returns:
- the detail models
-