Module is.codion.framework.model
Package is.codion.framework.model
Interface EntityEditor.EditorTasks
- Enclosing interface:
EntityEditor<R extends EntityEditor<R>>
public static interface EntityEditor.EditorTasks
Provides factory methods for creating EntityEditor.PersistTask and EntityEditor.RefreshTask 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.
-
Method Summary
Modifier and TypeMethodDescriptiondelete()delete(Collection<Entity> entities) insert()insert(Collection<Entity> entities) refresh()update()update(Collection<Entity> entities)
-
Method Details
-
insert
- Returns:
- a task for inserting the active entity
- Throws:
EntityValidationException- in case of validation failureIllegalStateException- in case inserting is not enabled
-
insert
- 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
-
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.PersistTask<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
-
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.PersistTask<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.PersistTask<Entity> delete()- Returns:
- a task for deleting the active entity
- Throws:
IllegalStateException- in case deleting is not enabled
-
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.RefreshTask refresh()- Returns:
- a task for refreshing the active entity
-