T - public class DatasourceImpl<T extends Entity> extends AbstractDatasource<T> implements DatasourceImplementation<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>| Constructor and Description |
|---|
DatasourceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Performs commit
|
void |
committed(java.util.Set<Entity> entities)
Invoked after commit.
|
DataSupplier |
getDataSupplier() |
DsContext |
getDsContext() |
T |
getItem() |
T |
getItemIfValid() |
MetaClass |
getMetaClass() |
Datasource.State |
getState() |
View |
getView() |
void |
initialized()
Moves the datasource to
State#INVALID. |
void |
invalidate()
Clears internal data and sets the datasource in
Datasource.State.INVALID state. |
void |
refresh()
Refreshes the datasource moving it to the
Datasource.State.VALID state |
void |
setDataSupplier(DataSupplier dataservice) |
void |
setDsContext(DsContext dsContext) |
void |
setItem(T item)
Set current entity in the datasource.
|
void |
setMetaClass(MetaClass metaClass) |
void |
setup(DsContext dsContext,
DataSupplier dataSupplier,
java.lang.String id,
MetaClass metaClass,
View view)
Setup the datasource right after creation.
|
void |
setView(java.lang.String viewName) |
void |
setView(View view) |
void |
valid()
Moves the datasource to
State#VALID. |
addItemChangeListener, addItemPropertyChangeListener, addListener, addStateChangeListener, clearCommitLists, deleted, enableListeners, getCommitMode, getId, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getLoadDynamicAttributes, getParent, isAllowCommit, isModified, modified, removeItemChangeListener, removeItemPropertyChangeListener, removeListener, removeStateChangeListener, setAllowCommit, setCommitMode, setLoadDynamicAttributes, setModified, setParent, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitclearCommitLists, deleted, enableListeners, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getParent, modified, setCommitMode, setModified, setParentaddItemChangeListener, addItemPropertyChangeListener, addListener, addStateChangeListener, getCommitMode, getId, getLoadDynamicAttributes, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeListener, removeStateChangeListener, setAllowCommit, setLoadDynamicAttributespublic void setup(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, MetaClass metaClass, @Nullable View view)
Datasourcesetup in interface Datasource<T extends Entity>setup in class AbstractDatasource<T extends Entity>dsContext - DsContext instancedataSupplier - DataSupplier instanceid - datasource IDmetaClass - MetaClass of an entity that will be stored in this datasourceview - a view that will be used to load entities form DB, can be nullpublic void setView(View view)
public void setView(java.lang.String viewName)
public DsContext getDsContext()
getDsContext in interface Datasource<T extends Entity>public void setDsContext(DsContext dsContext)
public DataSupplier getDataSupplier()
getDataSupplier in interface Datasource<T extends Entity>public void setDataSupplier(DataSupplier dataservice)
public void commit()
Datasourcecommit in interface Datasource<T extends Entity>public MetaClass getMetaClass()
getMetaClass in interface Datasource<T extends Entity>public void setMetaClass(MetaClass metaClass)
public View getView()
getView in interface Datasource<T extends Entity>public Datasource.State getState()
getState in interface Datasource<T extends Entity>public T getItem()
getItem in interface Datasource<T extends Entity>@Nullable public T getItemIfValid()
getItemIfValid in interface Datasource<T extends Entity>public void refresh()
DatasourceDatasource.State.VALID staterefresh in interface Datasource<T extends Entity>public void setItem(T item)
DatasourcesetItem in interface Datasource<T extends Entity>item - entity instancepublic void invalidate()
DatasourceDatasource.State.INVALID state.
In Datasource.State.NOT_INITIALIZED does nothing.invalidate in interface Datasource<T extends Entity>public void initialized()
DatasourceImplementationState#INVALID.initialized in interface DatasourceImplementation<T extends Entity>public void valid()
DatasourceImplementationState#VALID.valid in interface DatasourceImplementation<T extends Entity>public void committed(java.util.Set<Entity> entities)
DatasourceImplementationcommitted in interface DatasourceImplementation<T extends Entity>entities - committed entities returned from middleware