Interface ModelContext

All Known Implementing Classes:
DefaultModelContext, ModelContextProxy

public interface ModelContext
Collects all loaded, created or attached model instances managed by model service.
  • Field Details

  • Method Details

    • afterPersist

      void afterPersist(Collection<ModelWrapper> models)
    • attach

      void attach(Object model, Object source, ModelConverter conv)
      Attaches a new model to the context.
      Parameters:
      model - the model to hold
      source - the source element - may be null for new models
      conv - the converter used
      Throws:
      IllegalStateException - if there is a existing model mapped to the same source and converter
    • detach

      void detach(Object model, Object source, ModelConverter conv)
      Removes a model from context.
      Parameters:
      model - the model to remove
      source - its source - may be null for new models
      conv - the converter which manages the model
    • getAttached

      Object getAttached(Object source, ModelConverter conv)
      Returns a attached model for a given source element and converter.
      Parameters:
      source - the source element - must not be null
      conv - the converter
    • isAttached

      boolean isAttached(Object model, ModelConverter conv)
      Returns true if the given ItemModel and ModelConverter is attached to this/current. ModelContext.
      Returns:
      false otherwise.
    • clear

      void clear()
      Removes all attached models.
    • getNew

      Set<Object> getNew()
      Returns all attached model instances which are currently new.
    • getModified

      Set<Object> getModified()
      Returns all attached model instances which are currently modified.
    • afterDirectPersist

      void afterDirectPersist(Collection<ModelWrapper> wrappers)
      Clear context after save with generic DAO
    • afterDirectPersist

      void afterDirectPersist(ModelWrapper wr)
      Clear context after save with generic DAO
    • isLoading

      default boolean isLoading(PersistenceObject source)
    • markLoading

      default void markLoading(PersistenceObject source)
    • clearLoading

      default void clearLoading(PersistenceObject source)