@Deprecated public abstract class AbstractDatasource<T extends Entity> extends java.lang.Object implements Datasource<T>, DatasourceImplementation<T>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractDatasource.ItemListener
Deprecated.
|
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 | Field and Description |
|---|---|
protected boolean |
allowCommit
Deprecated.
|
protected BackgroundWorker |
backgroundWorker
Deprecated.
|
protected Datasource.CommitMode |
commitMode
Deprecated.
|
protected java.lang.String |
id
Deprecated.
|
protected java.util.Collection<Entity> |
itemsToCreate
Deprecated.
|
protected java.util.Collection<Entity> |
itemsToDelete
Deprecated.
|
protected java.util.Collection<Entity> |
itemsToUpdate
Deprecated.
|
protected Instance.PropertyChangeListener |
listener
Deprecated.
|
protected boolean |
listenersEnabled
Deprecated.
|
protected boolean |
loadDynamicAttributes
Deprecated.
|
protected Metadata |
metadata
Deprecated.
|
protected boolean |
modified
Deprecated.
|
protected Datasource |
parentDs
Deprecated.
|
| Constructor and Description |
|---|
AbstractDatasource()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItemChangeListener(Datasource.ItemChangeListener<T> listener)
Deprecated.
|
void |
addItemPropertyChangeListener(Datasource.ItemPropertyChangeListener<T> listener)
Deprecated.
|
protected void |
addParentsToNested()
Deprecated.
|
void |
addStateChangeListener(Datasource.StateChangeListener<T> listener)
Deprecated.
|
protected void |
attachListener(Instance item)
Deprecated.
|
void |
clearCommitLists()
Deprecated.
Clear new, modified and deleted lists.
|
void |
deleted(T item)
Deprecated.
Invoked when the given instance is deleted.
|
protected void |
detachListener(Instance item)
Deprecated.
|
boolean |
enableListeners(boolean enable)
Deprecated.
Enables or disables datasource listeners.
|
protected void |
fireItemChanged(T prevItem)
Deprecated.
|
protected void |
fireStateChanged(Datasource.State prevStatus)
Deprecated.
|
Datasource.CommitMode |
getCommitMode()
Deprecated.
|
protected EventRouter |
getEventRouter()
Deprecated.
Use EventRouter for listeners instead of fields with listeners List.
|
java.lang.String |
getId()
Deprecated.
|
java.util.Collection<T> |
getItemsToCreate()
Deprecated.
New instances to be committed.
|
java.util.Collection<T> |
getItemsToDelete()
Deprecated.
Deleted instances to be committed.
|
java.util.Collection<T> |
getItemsToUpdate()
Deprecated.
Modified instances to be committed.
|
boolean |
getLoadDynamicAttributes()
Deprecated.
|
Datasource |
getParent()
Deprecated.
Returns parent datasource or null.
|
boolean |
isAllowCommit()
Deprecated.
|
boolean |
isModified()
Deprecated.
|
void |
modified(T item)
Deprecated.
Invoked when the given instance is modified.
|
void |
removeItemChangeListener(Datasource.ItemChangeListener<T> listener)
Deprecated.
|
void |
removeItemPropertyChangeListener(Datasource.ItemPropertyChangeListener<T> listener)
Deprecated.
|
void |
removeStateChangeListener(Datasource.StateChangeListener<T> listener)
Deprecated.
|
void |
setAllowCommit(boolean allowCommit)
Deprecated.
Switch on/off ability to commit.
|
void |
setCommitMode(Datasource.CommitMode commitMode)
Deprecated.
Sets commit mode explicitly.
|
void |
setLoadDynamicAttributes(boolean value)
Deprecated.
|
void |
setModified(boolean modified)
Deprecated.
Sets "modified" state.
|
void |
setParent(Datasource datasource)
Deprecated.
Sets parent datasource.
|
void |
setup(DsContext dsContext,
DataSupplier dataSupplier,
java.lang.String id,
MetaClass metaClass,
View view)
Deprecated.
Setup the datasource right after creation.
|
java.lang.String |
toString()
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcommitted, initialized, validcommit, getDataSupplier, getDsContext, getItem, getItemIfValid, getMetaClass, getState, getView, invalidate, refresh, setItemprotected java.lang.String id
protected boolean modified
protected boolean allowCommit
protected Datasource.CommitMode commitMode
protected Datasource parentDs
protected Metadata metadata
protected BackgroundWorker backgroundWorker
protected java.util.Collection<Entity> itemsToCreate
protected java.util.Collection<Entity> itemsToUpdate
protected java.util.Collection<Entity> itemsToDelete
protected Instance.PropertyChangeListener listener
protected boolean listenersEnabled
protected boolean loadDynamicAttributes
protected EventRouter getEventRouter()
EventRouter instance.EventRouterpublic void setup(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, MetaClass metaClass, @Nullable View view)
Datasourcesetup in interface Datasource<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 java.lang.String getId()
getId in interface Datasource<T extends Entity>public boolean isModified()
isModified in interface Datasource<T extends Entity>public void setModified(boolean modified)
DatasourceImplementationsetModified in interface DatasourceImplementation<T extends Entity>public boolean isAllowCommit()
isAllowCommit in interface Datasource<T extends Entity>public void setAllowCommit(boolean allowCommit)
DatasourceDatasource.isModified() always returns false and Datasource.commit() has no effect.setAllowCommit in interface Datasource<T extends Entity>public java.util.Collection<T> getItemsToCreate()
DatasourceImplementationgetItemsToCreate in interface DatasourceImplementation<T extends Entity>public java.util.Collection<T> getItemsToUpdate()
DatasourceImplementationgetItemsToUpdate in interface DatasourceImplementation<T extends Entity>public java.util.Collection<T> getItemsToDelete()
DatasourceImplementationgetItemsToDelete in interface DatasourceImplementation<T extends Entity>public void modified(T item)
DatasourceImplementationmodified in interface DatasourceImplementation<T extends Entity>public void deleted(T item)
DatasourceImplementationdeleted in interface DatasourceImplementation<T extends Entity>public boolean enableListeners(boolean enable)
DatasourceImplementationenableListeners in interface DatasourceImplementation<T extends Entity>enable - true to enable, false to disablepublic Datasource.CommitMode getCommitMode()
getCommitMode in interface Datasource<T extends Entity>public void setCommitMode(Datasource.CommitMode commitMode)
DatasourceImplementationsetCommitMode in interface DatasourceImplementation<T extends Entity>DatasourceImplementation.setParent(Datasource)public Datasource getParent()
DatasourceImplementationIf a parent datasource is set, it will receive changed data from the current datasource on commit. Otherwise, the datasource commits to the database.
getParent in interface DatasourceImplementation<T extends Entity>public void setParent(Datasource datasource)
DatasourceImplementationIf a parent datasource is set, it will receive changed data from the current datasource on commit. Otherwise, the datasource commits to the database.
setParent in interface DatasourceImplementation<T extends Entity>protected void addParentsToNested()
public void addItemChangeListener(Datasource.ItemChangeListener<T> listener)
addItemChangeListener in interface Datasource<T extends Entity>public void removeItemChangeListener(Datasource.ItemChangeListener<T> listener)
removeItemChangeListener in interface Datasource<T extends Entity>public void addItemPropertyChangeListener(Datasource.ItemPropertyChangeListener<T> listener)
addItemPropertyChangeListener in interface Datasource<T extends Entity>public void removeItemPropertyChangeListener(Datasource.ItemPropertyChangeListener<T> listener)
removeItemPropertyChangeListener in interface Datasource<T extends Entity>public void addStateChangeListener(Datasource.StateChangeListener<T> listener)
addStateChangeListener in interface Datasource<T extends Entity>public void removeStateChangeListener(Datasource.StateChangeListener<T> listener)
removeStateChangeListener in interface Datasource<T extends Entity>public void clearCommitLists()
DatasourceImplementationclearCommitLists in interface DatasourceImplementation<T extends Entity>public boolean getLoadDynamicAttributes()
getLoadDynamicAttributes in interface Datasource<T extends Entity>public void setLoadDynamicAttributes(boolean value)
setLoadDynamicAttributes in interface Datasource<T extends Entity>value - whether to load dynamic attributesprotected void attachListener(Instance item)
protected void detachListener(Instance item)
protected void fireItemChanged(T prevItem)
protected void fireStateChanged(Datasource.State prevStatus)
public java.lang.String toString()
toString in class java.lang.Object