Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.PersistTask<T>
- Type Parameters:
T- the result type
- Enclosing interface:
EntityEditor<R extends EntityEditor<R>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a task for persisting entities, inserting, updating or deleting, split up for use with a background thread.
A EntityEditor.PersistTask captures entity state and fires "before" events at creation time.
It should be executed promptly after creation, not cached for later use.
// Must be called on the UI thread, fires "before" events and captures entity state
PersistTask<Entity> task = editor.tasks().insert();
// Can safely be called in a background thread
PersistTask.Result<Entity> result = task.perform();
// Must be called on the UI thread, fires "after" events
Entity insertedEntity = result.handle();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe task result -
Method Summary
-
Method Details
-
perform
EntityEditor.PersistTask.Result<T> perform()Performs the persist operation. May be called on a background thread.- Returns:
- the task result
-