Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditModel.EditTask
- Enclosing interface:
EntityEditModel
public static interface EntityEditModel.EditTask
Represents a task for inserting, updating or deleting entities, split up for use with a background thread.
EditTask insert = editModel.createInsert();
EditTask.Task task = insert.prepare();
// Can safely be called in a background thread
EditTask.Result result = task.perform();
Collection<Entity> insertedEntities = result.handle();
EntityEditModel.EditTask.Task.perform()
may be called on a background thread while prepare()
and EntityEditModel.EditTask.Result.handle()
must be called on the UI thread.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
The task resultstatic interface
The task performing the operation -
Method Summary
Modifier and TypeMethodDescriptionprepare()
Notifies listeners that an operation is about to be performed.
-
Method Details
-
prepare
EntityEditModel.EditTask.Task prepare()Notifies listeners that an operation is about to be performed. Must be called on the UI thread if this model has a panel based on it.- Returns:
- the task
-