Module is.codion.framework.model
Package is.codion.framework.model
Class DefaultEntityApplicationModel<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
java.lang.Object
is.codion.framework.model.DefaultEntityApplicationModel<M,E,T>
- Type Parameters:
M
- the type ofDefaultEntityModel
this application model is based onE
- the type ofAbstractEntityEditModel
used by thisEntityModel
T
- the type ofEntityTableModel
used by thisEntityModel
- All Implemented Interfaces:
EntityApplicationModel<M,
E, T>
- Direct Known Subclasses:
SwingEntityApplicationModel
public class DefaultEntityApplicationModel<M extends DefaultEntityModel<M,E,T>,E extends AbstractEntityEditModel,T extends EntityTableModel<E>>
extends Object
implements EntityApplicationModel<M,E,T>
A central application model class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.framework.model.EntityApplicationModel
EntityApplicationModel.EntityModels<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>> -
Field Summary
Fields inherited from interface is.codion.framework.model.EntityApplicationModel
AUTHENTICATION_REQUIRED, SAVE_DEFAULT_USERNAME, USERNAME_PREFIX
-
Constructor Summary
ConstructorDescriptionDefaultEntityApplicationModel
(EntityConnectionProvider connectionProvider) Instantiates a new DefaultEntityApplicationModelDefaultEntityApplicationModel
(EntityConnectionProvider connectionProvider, Version version) Instantiates a new DefaultEntityApplicationModel -
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 Entities
entities()
final EntityApplicationModel.EntityModels<M,
E, T> final void
refresh()
Refreshes all data models contained in this application modelfinal User
user()
version()
-
Constructor Details
-
DefaultEntityApplicationModel
Instantiates a new DefaultEntityApplicationModel- Parameters:
connectionProvider
- the EntityConnectionProvider instance- Throws:
NullPointerException
- in case connectionProvider is null
-
DefaultEntityApplicationModel
Instantiates a new DefaultEntityApplicationModel- Parameters:
connectionProvider
- the EntityConnectionProvider instanceversion
- the application version- Throws:
NullPointerException
- in case connectionProvider is null
-
-
Method Details
-
user
- Specified by:
user
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the current user
-
connectionProvider
- Specified by:
connectionProvider
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the EntityConnectionProvider instance being used by this EntityApplicationModel
-
connection
Description copied from interface:EntityApplicationModel
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 interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the connection used by this application model
-
version
- Specified by:
version
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the application version, an empty Optional in case no version information is available
-
entities
- Specified by:
entities
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the underlying domain entities
-
entityModels
- Specified by:
entityModels
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>> - Returns:
- the
EntityApplicationModel.EntityModels
-
refresh
public final void refresh()Description copied from interface:EntityApplicationModel
Refreshes all data models contained in this application model- Specified by:
refresh
in interfaceEntityApplicationModel<M extends DefaultEntityModel<M,
E, T>, E extends AbstractEntityEditModel, T extends EntityTableModel<E>>
-