Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.PersistTask
- Enclosing interface:
EntityEditor<M extends EntityModel<M,E, T, R>, E extends EntityEditModel<M, E, T, R>, T extends EntityTableModel<M, E, T, R>, R extends EntityEditor<M, E, T, R>>
public static interface EntityEditor.PersistTask
Represents a task for persisting entities, inserting, updating or deleting, split up for use with a background thread.
PersistTask insert = editor.insert().build();
PersistTask.Task task = insert.prepare();
// Can safely be called in a background thread
PersistTask.Result result = task.perform();
Collection<Entity> insertedEntities = result.handle();
EntityEditor.PersistTask.Task.perform() may be called on a background thread while prepare()
and EntityEditor.PersistTask.Result.handle() must be called on the UI thread.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe task resultstatic interfaceThe task performing the operation -
Method Summary
Modifier and TypeMethodDescriptionprepare()Notifies listeners that an operation is about to be performed.
-
Method Details
-
prepare
EntityEditor.PersistTask.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
-