- Enclosing interface:
- EntityEditModel
public static interface EntityEditModel.Insert
Represents a task for inserting entities, split up for use with a background thread.
Insert insert = editModel.createInsert(); insert.notifyBeforeInsert(); // Can safely be called in a background thread Collection<Entity> insertedEntities = insert.insert(); insert.notifyAfterInsert(insertedEntities);
insert() may be called on a background thread while EntityEditModel.validate(), notifyBeforeInsert()
and notifyAfterInsert(Collection) must be called on the UI thread.-
Method Summary
Modifier and TypeMethodDescriptionCollection<is.codion.framework.domain.entity.Entity>insert()May be called in a background thread.voidnotifyAfterInsert(Collection<is.codion.framework.domain.entity.Entity> insertedEntities) Notifies listeners that an insert has been performed.voidNotifies listeners that an insert is about to be performed.
-
Method Details
-
notifyBeforeInsert
void notifyBeforeInsert()Notifies listeners that an insert is about to be performed. Must be called on the UI thread if this model has a panel based on it. -
insert
Collection<is.codion.framework.domain.entity.Entity> insert() throws is.codion.common.db.exception.DatabaseExceptionMay be called in a background thread.- Returns:
- the inserted entities
- Throws:
is.codion.common.db.exception.DatabaseException- in case of a database exception
-
notifyAfterInsert
Notifies listeners that an insert has been performed. Must be called on the UI thread if this model has a panel based on it.- Parameters:
insertedEntities- the entities returned byinsert()
-