public class EmbeddedDatasourceImpl<T extends EmbeddableEntity> extends AbstractDatasource<T> implements Datasource<T>, DatasourceImplementation<T>, EmbeddedDatasource<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 |
---|
EmbeddedDatasourceImpl() |
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() |
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 |
getMaster() |
MetaClass |
getMetaClass() |
MetaProperty |
getProperty() |
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 |
modified(T item)
Invoked when the given instance is modified.
|
void |
refresh()
Refreshes the datasource moving it to the
Datasource.State.VALID state |
void |
setItem(T item)
Set current entity in the datasource.
|
void |
setup(java.lang.String id,
Datasource masterDs,
java.lang.String property)
Setup the datasource right after creation.
|
void |
valid()
Moves the datasource to
State#VALID . |
addItemChangeListener, addItemPropertyChangeListener, addListener, addStateChangeListener, clearCommitLists, deleted, enableListeners, getCommitMode, getId, getLoadDynamicAttributes, getParent, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeListener, removeStateChangeListener, setAllowCommit, setCommitMode, setLoadDynamicAttributes, setModified, setParent, setup, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearCommitLists, deleted, enableListeners, getParent, setCommitMode, setModified, setParent
addItemChangeListener, addItemPropertyChangeListener, addListener, addStateChangeListener, getCommitMode, getId, getLoadDynamicAttributes, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeListener, removeStateChangeListener, setAllowCommit, setLoadDynamicAttributes, setup
public void setup(java.lang.String id, Datasource masterDs, java.lang.String property)
NestedDatasource
setup
in interface NestedDatasource<T extends EmbeddableEntity>
id
- datasource IDmasterDs
- master datasourceproperty
- property of the master datasource to bound this datasource topublic DsContext getDsContext()
getDsContext
in interface Datasource<T extends EmbeddableEntity>
public DataSupplier getDataSupplier()
getDataSupplier
in interface Datasource<T extends EmbeddableEntity>
public void commit()
Datasource
commit
in interface Datasource<T extends EmbeddableEntity>
public Datasource.State getState()
getState
in interface Datasource<T extends EmbeddableEntity>
public T getItem()
getItem
in interface Datasource<T extends EmbeddableEntity>
@Nullable public T getItemIfValid()
getItemIfValid
in interface Datasource<T extends EmbeddableEntity>
public void setItem(T item)
Datasource
setItem
in interface Datasource<T extends EmbeddableEntity>
item
- entity instancepublic MetaClass getMetaClass()
getMetaClass
in interface Datasource<T extends EmbeddableEntity>
public View getView()
getView
in interface Datasource<T extends EmbeddableEntity>
public void committed(java.util.Set<Entity> entities)
DatasourceImplementation
committed
in interface DatasourceImplementation<T extends EmbeddableEntity>
entities
- committed entities returned from middlewarepublic Datasource getMaster()
getMaster
in interface NestedDatasource<T extends EmbeddableEntity>
public MetaProperty getProperty()
getProperty
in interface NestedDatasource<T extends EmbeddableEntity>
public void invalidate()
Datasource
Datasource.State.INVALID
state.
In Datasource.State.NOT_INITIALIZED
does nothing.invalidate
in interface Datasource<T extends EmbeddableEntity>
public void refresh()
Datasource
Datasource.State.VALID
staterefresh
in interface Datasource<T extends EmbeddableEntity>
public void initialized()
DatasourceImplementation
State#INVALID
.initialized
in interface DatasourceImplementation<T extends EmbeddableEntity>
public void valid()
DatasourceImplementation
State#VALID
.valid
in interface DatasourceImplementation<T extends EmbeddableEntity>
public void modified(T item)
DatasourceImplementation
modified
in interface DatasourceImplementation<T extends EmbeddableEntity>
modified
in class AbstractDatasource<T extends EmbeddableEntity>
public java.util.Collection<T> getItemsToCreate()
DatasourceImplementation
getItemsToCreate
in interface DatasourceImplementation<T extends EmbeddableEntity>
getItemsToCreate
in class AbstractDatasource<T extends EmbeddableEntity>
public java.util.Collection<T> getItemsToUpdate()
DatasourceImplementation
getItemsToUpdate
in interface DatasourceImplementation<T extends EmbeddableEntity>
getItemsToUpdate
in class AbstractDatasource<T extends EmbeddableEntity>
public java.util.Collection<T> getItemsToDelete()
DatasourceImplementation
getItemsToDelete
in interface DatasourceImplementation<T extends EmbeddableEntity>
getItemsToDelete
in class AbstractDatasource<T extends EmbeddableEntity>