Interface EntityEditor.EditorTasks
- Enclosing interface:
EntityEditor<R extends EntityEditor<R>>
Provides factory methods for creating EntityEditor.EditorTask instances.
Each factory method validates the input, captures entity state and fires "before" events. Must be called on the UI thread if the editor is linked to UI components. The returned task should be executed promptly, not cached for later use.
The result of a task persisting the active entity replaces it with the one persisted, or resets it after a delete, unless the editor has moved on to another entity since the task was created, being set, replaced by one with another primary key, or reset, which it then leaves alone, the "after" events firing all the same. An edit made to the active entity meanwhile does not move it on, and is overwritten.
-
Method Summary
Modifier and TypeMethodDescriptiondelete()delete(Collection<Entity> entities) insert()A null the active entity holds in a column whose default the database provides,withDefault(), is left out of the entity inserted, so the database fills it in, whether the value was never given, given and then cleared, or reverted.insert(Collection<Entity> entities) Asinsert(), with the given consumer called on the entity inserted, on the thread performing the task.refresh()update()update(Collection<Entity> entities)
-
Method Details
-
insert
A null the active entity holds in a column whose default the database provides,
withDefault(), is left out of the entity inserted, so the database fills it in, whether the value was never given, given and then cleared, or reverted. Such a column can therefore not be inserted as null via the active entity, the entities given toinsert(Entity)andinsert(Collection)being inserted as they are.- Returns:
- a task for inserting the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled, or the detail editors do not hold the details of the active entity, seeEntityEditor.DetailEditors
-
insert
Asinsert(), with the given consumer called on the entity inserted, on the thread performing the task.- Parameters:
before- called on the entity before it is inserted- Returns:
- a task for inserting the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled, or the detail editors do not hold the details of the active entity, seeEntityEditor.DetailEditors
-
insert
- Parameters:
entity- the entity- Returns:
- a task for inserting the given entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
insert
EntityEditor.EditorTask<Collection<Entity>> insert(Collection<Entity> entities) throws EntityValidationException - Parameters:
entities- the entities- Returns:
- a task for inserting the given entities
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
update
- Returns:
- a task for updating the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case updating is not enabled, the active entity is not modified, or the detail editors do not hold its details, seeEntityEditor.DetailEditors
-
update
- Parameters:
entity- the entity- Returns:
- a task for updating the given entity
- Throws:
IllegalStateException- in case the entity is not modified or if updating is not enabledEntityValidationException- in case of validation failure
-
update
EntityEditor.EditorTask<Collection<Entity>> update(Collection<Entity> entities) throws EntityValidationException - Parameters:
entities- the entities- Returns:
- a task for updating the given entities
- Throws:
IllegalStateException- in case the entity is not modified or if updating is not enabledEntityValidationException- in case of validation failure
-
delete
EntityEditor.EditorTask<Entity> delete()- Returns:
- a task for deleting the active entity
- Throws:
IllegalStateException- in case deleting is not enabled, or the detail editors do not hold the details of the active entity, seeEntityEditor.DetailEditors
-
delete
- Parameters:
entity- the entity- Returns:
- a task for deleting the given entity
- Throws:
IllegalStateException- in case deleting is not enabled
-
delete
- Parameters:
entities- the entities- Returns:
- a task for deleting the given entities
- Throws:
IllegalStateException- in case deleting is not enabled
-
refresh
EntityEditor.EditorTask<Entity> refresh()- Returns:
- a task for refreshing the active entity
- Throws:
IllegalStateException- in case the active entity does not exist- See Also:
-