- 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 TypeMethodDescriptionvoidnotifyAfterUpdate(Collection<is.codion.framework.domain.entity.Entity> updatedEntities) Notifies listeners that an update has been performed.voidNotifies listeners that an update is about to be performed.Collection<is.codion.framework.domain.entity.Entity>update()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.DatabaseExceptionMay be called in a background thread.- Returns:
- the updated entities
- Throws:
is.codion.common.db.exception.DatabaseException- in case of a database exception
-
notifyAfterUpdate
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 byupdate()
-