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 - the EntityModel type
E - the EntityEditModel type
T - the EntityTableModel type
R - the EntityEditor type
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.
  • Field Details

    • USER_PREFERENCES

      static final PropertyValue<Boolean> USER_PREFERENCES
      Specifies whether the client should apply and save user preferences
      • Value type: Boolean
      • Default value: true
    • PREFERENCES_KEY

      static final PropertyValue<String> 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
    • connection

      EntityConnection connection()

      Returns the EntityConnection used by this application model, a single self-managing instance shared by all its entity models: it validates the underlying connection before each operation and re-establishes it when it has gone bad, so it is safe to hold on to and use for the lifetime of the application, see EntityConnection.builder().

      Returns:
      the connection used by this application model
    • entities

      Entities entities()
      Returns:
      the underlying domain entities
    • models

      Returns:
      the EntityApplicationModel.EntityModels
    • store

      void store(Preferences preferences)
      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 its EntityModel.preferencesKey(). May be overridden to persist custom state, in which case super.store(preferences) should be called in order to retain the default state.

      Custom state belongs in a child node of its own, named so as not to clash with a model's preferences key.

      Parameters:
      preferences - the preferences node representing the entity models
      See Also:
    • restore

      void restore(Preferences preferences)
      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 its EntityModel.preferencesKey().
      Parameters:
      preferences - the preferences node representing the entity models
      See Also: