Interface EntityEditor.PersistTask<T>

Type Parameters:
T - the result type
Enclosing interface:
EntityEditor

public static interface EntityEditor.PersistTask<T>
Represents a task for persisting entities, inserting, updating or deleting, split up for use with a background thread.
   PersistTask<Entity> insert = editor.insert().build();

   PersistTask.Task<Entity> task = insert.prepare();

   // Can safely be called in a background thread
   PersistTask.Result<Entity> result = task.perform();

   Entity insertedEntity = 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.
  • Method Details

    • 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