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
Modifier 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
Modifier and TypeFieldDescriptionstatic final PropertyValue<Boolean>
Specifies whether user authentication is required Value type: Boolean Default value: truestatic 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 a string to prepend to the username field in the login dialog Value type: String Default value: [empty string] -
Method Summary
-
Field Details
-
USERNAME_PREFIX
Specifies a string to prepend to the username field in the login dialog- Value type: String
- Default value: [empty string]
-
AUTHENTICATION_REQUIRED
Specifies whether user authentication is required- Value type: Boolean
- Default value: true
-
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
-
-
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
-
refresh
void refresh()Refreshes all data models contained in this application model
-