Module is.codion.framework.model
Package is.codion.framework.model
Class AbstractEntityApplicationModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<R>,T extends EntityTableModel<E,R>,R extends EntityEditor<R>>
java.lang.Object
is.codion.framework.model.AbstractEntityApplicationModel<M,E,T,R>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltypeR- theEntityEditortype
- All Implemented Interfaces:
EntityApplicationModel<M,E, T, R>
- Direct Known Subclasses:
SwingEntityApplicationModel
public abstract class AbstractEntityApplicationModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<R>,T extends EntityTableModel<E,R>,R extends EntityEditor<R>>
extends Object
implements EntityApplicationModel<M,E,T,R>
An abstract
EntityApplicationModel implementation.-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.framework.model.EntityApplicationModel
EntityApplicationModel.EntityModels<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> -
Field Summary
Fields inherited from interface is.codion.framework.model.EntityApplicationModel
PREFERENCES_KEY, USER_PREFERENCES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEntityApplicationModel(EntityConnectionProvider connectionProvider, Collection<? extends M> entityModels) Instantiates a new AbstractEntityApplicationModel, using the default file based preferences.protectedAbstractEntityApplicationModel(EntityConnectionProvider connectionProvider, Collection<? extends M> entityModels, Preferences preferences) Instantiates a new AbstractEntityApplicationModel -
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 Entitiesentities()final EntityApplicationModel.EntityModels<M, E, T, R> models()final PreferencesReturns file-based preferences using the domain name as identifier orEntityApplicationModel.PREFERENCES_KEYif specified.final Useruser()
-
Constructor Details
-
AbstractEntityApplicationModel
protected AbstractEntityApplicationModel(EntityConnectionProvider connectionProvider, Collection<? extends M> entityModels) Instantiates a new AbstractEntityApplicationModel, using the default file based preferences.- Parameters:
connectionProvider- the EntityConnectionProvider instanceentityModels- the entity models- Throws:
NullPointerException- in case connectionProvider is null
-
AbstractEntityApplicationModel
protected AbstractEntityApplicationModel(EntityConnectionProvider connectionProvider, Collection<? extends M> entityModels, Preferences preferences) Instantiates a new AbstractEntityApplicationModelNote that the associated application panel reads startup preferences (frame size, look and feel, default username) from the default file based preferences root before the model is instantiated, so those specific preferences are not read from or stored under the given
Preferencesinstance.- Parameters:
connectionProvider- the EntityConnectionProvider instanceentityModels- the entity modelspreferences- thePreferencesinstance to use- Throws:
NullPointerException- in case connectionProvider is null
-
-
Method Details
-
user
- Specified by:
userin interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the current user
-
connectionProvider
- Specified by:
connectionProviderin interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the EntityConnectionProvider instance being used by this EntityApplicationModel
-
connection
Description copied from interface:EntityApplicationModelDo 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 interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the connection used by this application model
-
entities
- Specified by:
entitiesin interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the underlying domain entities
-
models
- Specified by:
modelsin interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the
EntityApplicationModel.EntityModels
-
preferences
Description copied from interface:EntityApplicationModelReturns file-based preferences using the domain name as identifier orEntityApplicationModel.PREFERENCES_KEYif specified. This is used for the hierarchical JSON preferences format.- Specified by:
preferencesin interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Returns:
- the application preferences instance
- See Also:
-