- 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 TypeMethodDescriptionCollection<is.codion.framework.domain.entity.Entity>delete()May be called in a background thread.voidnotifyAfterDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities) Must be called on the UI thread if this model has a panel based on it.voidNotifies 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.DatabaseExceptionMay be called in a background thread.- Returns:
- the deleted entities
- Throws:
is.codion.common.db.exception.DatabaseException- in case of a database exception
-
notifyAfterDelete
Must be called on the UI thread if this model has a panel based on it.- Parameters:
deletedEntities- the entities returned bydelete()
-