Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityApplicationModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<R>,T extends EntityTableModel<E,R>,R extends EntityEditor<R>>
- Type Parameters:
M- theEntityModeltypeE- theEntityEditModeltypeT- theEntityTableModeltypeR- theEntityEditortype
- All Known Implementing Classes:
AbstractEntityApplicationModel,SwingEntityApplicationModel
public interface EntityApplicationModel<M extends EntityModel<M,E,T,R>,E extends EntityEditModel<R>,T extends EntityTableModel<E,R>,R extends EntityEditor<R>>
A central application model, coordinating the
EntityModel instances of an application.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceEntityApplicationModel.EntityModels<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<R>, T extends EntityTableModel<E, R>, R extends EntityEditor<R>> Manages theEntityModels for aEntityApplicationModel -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<String> Specifies the key to use when creating file based application preferences.static final PropertyValue<Boolean> Specifies whether the client should apply and save user preferences Value type: Boolean Default value: true -
Method Summary
Modifier and TypeMethodDescriptionDo not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.entities()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.user()
-
Field Details
-
USER_PREFERENCES
Specifies whether the client should apply and save user preferences- Value type: Boolean
- Default value: true
-
PREFERENCES_KEY
Specifies the key to use when creating file based application preferences. Note that this string may only contain valid filename characters and symbols.- Value type: String
- Default value: null
-
-
Method Details
-
user
User user()- Returns:
- the current user
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the EntityConnectionProvider instance being used by this EntityApplicationModel
-
connection
EntityConnection connection()Do not cache or keep the connection returned by this method in a long living field, since it may become invalid and thereby unusable.- Returns:
- the connection used by this application model
-
entities
Entities entities()- Returns:
- the underlying domain entities
-
models
EntityApplicationModel.EntityModels<M,E, models()T, R> - Returns:
- the
EntityApplicationModel.EntityModels
-
store
Stores 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.- Parameters:
preferences- the preferences node representing the entity models- See Also:
-
restore
Restores 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().- Parameters:
preferences- the preferences node representing the entity models- See Also:
-