public interface DatasourceImplementation<T extends Entity> extends Datasource<T>
Datasource.CommitMode, Datasource.ItemChangeEvent<T extends Entity>, Datasource.ItemChangeListener<T extends Entity>, Datasource.ItemPropertyChangeEvent<T extends Entity>, Datasource.ItemPropertyChangeListener<T extends Entity>, Datasource.State, Datasource.StateChangeEvent<T extends Entity>, Datasource.StateChangeListener<T extends Entity>
Modifier and Type | Method and Description |
---|---|
void |
clearCommitLists()
Clear new, modified and deleted lists.
|
void |
committed(java.util.Set<Entity> entities)
Invoked after commit.
|
void |
deleted(T item)
Invoked when the given instance is deleted.
|
boolean |
enableListeners(boolean enable)
Enables or disables datasource listeners.
|
java.util.Collection<T> |
getItemsToCreate()
New instances to be committed.
|
java.util.Collection<T> |
getItemsToDelete()
Deleted instances to be committed.
|
java.util.Collection<T> |
getItemsToUpdate()
Modified instances to be committed.
|
Datasource |
getParent()
Returns parent datasource or null.
|
void |
initialized()
Moves the datasource to
State#INVALID . |
void |
modified(T item)
Invoked when the given instance is modified.
|
void |
setCommitMode(Datasource.CommitMode commitMode)
Sets commit mode explicitly.
|
void |
setModified(boolean modified)
Sets "modified" state.
|
void |
setParent(Datasource datasource)
Sets parent datasource.
|
void |
valid()
Moves the datasource to
State#VALID . |
addItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, commit, getCommitMode, getDataSupplier, getDsContext, getId, getItem, getItemIfValid, getLoadDynamicAttributes, getMetaClass, getState, getView, invalidate, isAllowCommit, isModified, refresh, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setItem, setLoadDynamicAttributes, setup
void initialized()
State#INVALID
.void valid()
State#VALID
.void setModified(boolean modified)
void setCommitMode(Datasource.CommitMode commitMode)
setParent(Datasource)
@Nullable Datasource getParent()
If a parent datasource is set, it will receive changed data from the current datasource on commit. Otherwise, the datasource commits to the database.
void setParent(Datasource datasource)
If a parent datasource is set, it will receive changed data from the current datasource on commit. Otherwise, the datasource commits to the database.
java.util.Collection<T> getItemsToCreate()
java.util.Collection<T> getItemsToUpdate()
java.util.Collection<T> getItemsToDelete()
void modified(T item)
void deleted(T item)
void committed(java.util.Set<Entity> entities)
entities
- committed entities returned from middlewareboolean enableListeners(boolean enable)
enable
- true to enable, false to disablevoid clearCommitLists()