Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityApplicationModel<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
- Type Parameters:
M
- the type ofEntityModel
this application model is based onE
- the type ofEntityEditModel
used by thisEntityModel
T
- the type ofEntityTableModel
used by thisEntityModel
- All Known Implementing Classes:
DefaultEntityApplicationModel
,SwingEntityApplicationModel
public interface EntityApplicationModel<M extends EntityModel<M,E,T>,E extends EntityEditModel,T extends EntityTableModel<E>>
A central application model class.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
EntityApplicationModel.EntityModels<M extends EntityModel<M,
E, T>, E extends EntityEditModel, T extends EntityTableModel<E>> Manages theEntityModel
s 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 application should restore default preferences, that is, not load any saved user preferences.static final PropertyValue
<Boolean> Specifies whether the client saves the last successful login username, which is then displayed as the default username the next time the application is started Value type: Boolean Default value: truestatic final PropertyValue
<String> Specifies the user for logging into the application on the formuser:password
.static final PropertyValue
<Boolean> Specifies whether the client should apply and save user preferences Value type: Boolean Default value: true -
Method Summary
-
Field Details
-
SAVE_DEFAULT_USERNAME
Specifies whether the client saves the last successful login username, which is then displayed as the default username the next time the application is started- Value type: Boolean
- Default value: true
-
USER
Specifies the user for logging into the application on the formuser:password
. If one is specified no login dialog is presented.Initialized with the value of the CODION_CLIENT_USER environment variable.
Warning: System properties are visible in process listings. Use only for development/testing. In production, use secure credential management.
- Value type: String
- Default value: System.getenv("CODION_CLIENT_USER")
- See Also:
-
USER_PREFERENCES
Specifies whether the client should apply and save user preferences- Value type: Boolean
- Default value: true
-
RESTORE_DEFAULT_PREFERENCES
Specifies whether the application should restore default preferences, that is, not load any saved user preferences.- Value type: Boolean
- Default value: false
-
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
-
version
- Returns:
- the application version, an empty Optional in case no version information is available
-
entities
Entities entities()- Returns:
- the underlying domain entities
-
entityModels
EntityApplicationModel.EntityModels<M,E, entityModels()T> - Returns:
- the
EntityApplicationModel.EntityModels
-
preferences
Preferences preferences()- Returns:
- the application preferences instance
- See Also:
-
refresh
void refresh()Refreshes all data models contained in this application model
-