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 -
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()voidrestore(Preferences preferences) Restores the model-owned persistent state of this application's model tree from the given preferences node.voidstore(Preferences preferences) Stores the model-owned persistent state of this application's model tree to the given preferences node.final Useruser()
-
Constructor Details
-
AbstractEntityApplicationModel
protected AbstractEntityApplicationModel(EntityConnectionProvider connectionProvider, Collection<? extends M> entityModels) Instantiates a new AbstractEntityApplicationModel- Parameters:
connectionProvider- the EntityConnectionProvider instanceentityModels- the entity models- 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
-
store
Description copied from interface:EntityApplicationModelStores the model-owned persistent state of this application's model tree to the given preferences node. Each root model stores its state under a child node named by itsEntityModel.preferencesKey(). May be overridden to persist custom state, in which casesuper.store(preferences)should be called in order to retain the default state.- Specified by:
storein interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Parameters:
preferences- the preferences node representing the entity models- See Also:
-
restore
Description copied from interface:EntityApplicationModelRestores the model-owned persistent state of this application's model tree from the given preferences node. Each root model restores its state from a child node named by itsEntityModel.preferencesKey().- Specified by:
restorein interfaceEntityApplicationModel<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> - Parameters:
preferences- the preferences node representing the entity models- See Also:
-