Interface EntityEditModel.Update

Enclosing interface:
EntityEditModel

public static interface EntityEditModel.Update
Represents a task for updating entities.
   Update update = editModel.createUpdate();

   update.notifyBeforeUpdate();

   // Can safely be called in a background thread
   Collection<Entity> updatedEntities = update.update();

   update.notifyAfterUpdate(updatedEntities);
 
update() may be called on a background thread while EntityEditModel.validate(), notifyBeforeUpdate() and notifyAfterUpdate(Collection) must be called on the UI thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    notifyAfterUpdate(Collection<is.codion.framework.domain.entity.Entity> updatedEntities)
    Notifies listeners that an update has been performed.
    void
    Notifies listeners that an update is about to be performed.
    Collection<is.codion.framework.domain.entity.Entity>
    May be called in a background thread.
  • Method Details

    • notifyBeforeUpdate

      void notifyBeforeUpdate()
      Notifies listeners that an update is about to be performed. Must be called on the UI thread if this model has a panel based on it.
    • update

      Collection<is.codion.framework.domain.entity.Entity> update() throws is.codion.common.db.exception.DatabaseException
      May be called in a background thread.
      Returns:
      the updated entities
      Throws:
      is.codion.common.db.exception.DatabaseException - in case of a database exception
    • notifyAfterUpdate

      void notifyAfterUpdate(Collection<is.codion.framework.domain.entity.Entity> updatedEntities)
      Notifies listeners that an update has been performed. Must be called on the UI thread if this model has a panel based on it.
      Parameters:
      updatedEntities - the entities returned by update()