Interface EntityEditModel.Delete

Enclosing interface:
EntityEditModel

public static interface EntityEditModel.Delete
Represents a task for deleting entities.
   Delete delete = editModel.createDelete();

   delete.notifyBeforeDelete();

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

   delete.notifyAfterDelete(deletedEntities);
 
delete() may be called on a background thread while notifyBeforeDelete() and notifyAfterDelete(Collection) must be called on the UI thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    Collection<is.codion.framework.domain.entity.Entity>
    May be called in a background thread.
    void
    notifyAfterDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities)
    Must be called on the UI thread if this model has a panel based on it.
    void
    Notifies listeners that a delete is about to be performed.
  • Method Details

    • notifyBeforeDelete

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

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

      void notifyAfterDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities)
      Must be called on the UI thread if this model has a panel based on it.
      Parameters:
      deletedEntities - the entities returned by delete()