T - type of entityK - type of entity ID@Deprecated public abstract class AbstractCollectionDatasource<T extends io.jmix.core.Entity,K> extends DatasourceImpl<T> implements CollectionDatasource<T,K>, CollectionDatasource.SupportsRefreshMode<T,K>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractCollectionDatasource.ComponentValueListener
Deprecated.
|
AbstractDatasource.ItemListenerCollectionDatasource.Aggregatable<T extends io.jmix.core.Entity,K>, CollectionDatasource.CollectionChangeEvent<T extends io.jmix.core.Entity,K>, CollectionDatasource.CollectionChangeListener<T extends io.jmix.core.Entity,K>, CollectionDatasource.Indexed<T extends io.jmix.core.Entity,K>, CollectionDatasource.Lazy<T extends io.jmix.core.Entity,K>, CollectionDatasource.Operation, CollectionDatasource.Ordered<T extends io.jmix.core.Entity,K>, CollectionDatasource.RefreshMode, CollectionDatasource.Sortable<T extends io.jmix.core.Entity,K>, CollectionDatasource.SortDelegate<T extends io.jmix.core.Entity,K>, CollectionDatasource.SupportsApplyToSelected<T extends io.jmix.core.Entity,K>, CollectionDatasource.SupportsPaging<T extends io.jmix.core.Entity,K>, CollectionDatasource.SupportsRefreshMode<T extends io.jmix.core.Entity,K>, CollectionDatasource.SupportsSortDelegate<T extends io.jmix.core.Entity,K>, CollectionDatasource.Suspendable<T extends io.jmix.core.Entity,K>, CollectionDatasource.UnmuteEventsModeDatasource.CommitMode, Datasource.ItemChangeEvent<T extends io.jmix.core.Entity>, Datasource.ItemChangeListener<T extends io.jmix.core.Entity>, Datasource.ItemPropertyChangeEvent<T extends io.jmix.core.Entity>, Datasource.ItemPropertyChangeListener<T extends io.jmix.core.Entity>, Datasource.State, Datasource.StateChangeEvent<T extends io.jmix.core.Entity>, Datasource.StateChangeListener<T extends io.jmix.core.Entity>| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cacheable
Deprecated.
|
protected AbstractCollectionDatasource.ComponentValueListener |
componentValueListener
Deprecated.
|
protected java.lang.Throwable |
dataLoadError
Deprecated.
|
protected QueryFilter |
filter
Deprecated.
|
protected boolean |
listenersSuspended
Deprecated.
|
protected int |
maxResults
Deprecated.
|
protected java.lang.String |
query
Deprecated.
|
protected ParameterInfo[] |
queryParameters
Deprecated.
|
protected CollectionDatasource.RefreshMode |
refreshMode
Deprecated.
|
protected boolean |
refreshOnComponentValueChange
Deprecated.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
savedParameters
Deprecated.
|
protected boolean |
softDeletion
Deprecated.
|
protected CollectionDatasource.Sortable.SortInfo<io.jmix.core.metamodel.model.MetaPropertyPath>[] |
sortInfos
Deprecated.
|
protected java.util.LinkedList<CollectionDatasource.CollectionChangeEvent<T,K>> |
suspendedEvents
Deprecated.
|
protected UserSession |
userSession
Deprecated.
|
dataSupplier, dsContext, item, metaClass, state, viewallowCommit, backgroundWorker, commitMode, id, itemsToCreate, itemsToDelete, itemsToUpdate, listener, listenersEnabled, loadDynamicAttributes, metadata, modified, parentDs| Constructor and Description |
|---|
AbstractCollectionDatasource()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCollectionChangeListener(CollectionDatasource.CollectionChangeListener<? super T,K> listener)
Deprecated.
|
protected void |
checkDataLoadError()
Deprecated.
|
void |
commit()
Deprecated.
Performs commit
|
protected io.jmix.core.DataLoadContextQuery |
createDataQuery(io.jmix.core.DataLoadContext context,
java.util.Map<java.lang.String,java.lang.Object> params)
Deprecated.
|
protected java.util.Comparator<T> |
createEntityComparator()
Deprecated.
|
protected void |
fireCollectionChanged(CollectionDatasource.Operation operation,
java.util.List<T> items)
Deprecated.
|
LoadContext |
getCompiledLoadContext()
Deprecated.
|
int |
getCount()
Deprecated.
Return number of rows for the current query set in the datasource.
|
T |
getItemNN(K id)
Deprecated.
|
protected java.lang.String |
getJPQLQuery(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.Object> |
getLastRefreshParameters()
Deprecated.
Returns the parameters last used in
CollectionDatasource.refresh(Map) method or empty map if there was no refresh with parameters |
protected java.lang.String |
getLoggingTag(java.lang.String prefix)
Deprecated.
|
int |
getMaxResults()
Deprecated.
|
java.lang.String |
getQuery()
Deprecated.
|
QueryFilter |
getQueryFilter()
Deprecated.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getQueryParameters(java.util.Map<java.lang.String,java.lang.Object> params)
Deprecated.
|
CollectionDatasource.RefreshMode |
getRefreshMode()
Deprecated.
|
boolean |
getRefreshOnComponentValueChange()
Deprecated.
Whether to refresh datasource on changing value of a component which it depends on
(through
component$ parameter) |
protected java.util.Map<java.lang.String,java.lang.Object> |
getTemplateParams(java.util.Map<java.lang.String,java.lang.Object> customParams)
Deprecated.
|
boolean |
isCacheable()
Deprecated.
|
boolean |
isSoftDeletion()
Deprecated.
|
protected java.lang.String |
makeCaseInsensitive(java.lang.String value)
Deprecated.
|
void |
mute()
Deprecated.
Disables all event listeners on datasource data change.
|
protected void |
prepareLoadContext(LoadContext<?> context)
Deprecated.
|
void |
removeCollectionChangeListener(CollectionDatasource.CollectionChangeListener<? super T,K> listener)
Deprecated.
|
void |
resumeListeners()
Deprecated.
Resume invocation of
collectionChanged method of registered CollectionDatasource.CollectionChangeListeners
after calling CollectionDatasource.suspendListeners(). |
void |
setCacheable(boolean cacheable)
Deprecated.
Indicates that the datasource query results should be cached in the middleware query cache.
|
void |
setItem(T item)
Deprecated.
Set current entity in the datasource.
|
void |
setMaxResults(int maxResults)
Deprecated.
Set max number of rows.
|
void |
setQuery(java.lang.String query)
Deprecated.
Set query string which is used to load data.
|
void |
setQuery(java.lang.String query,
QueryFilter filter)
Deprecated.
Set query string and associated filter which is used to load data.
|
void |
setQueryFilter(QueryFilter filter)
Deprecated.
Set query filter which is used to load data.
|
void |
setRefreshMode(CollectionDatasource.RefreshMode refreshMode)
Deprecated.
|
void |
setRefreshOnComponentValueChange(boolean refresh)
Deprecated.
Whether to refresh datasource on changing value of a component which it depends on
(through
component$ parameter) |
void |
setSoftDeletion(boolean softDeletion)
Deprecated.
Switch on/off Soft Deletion.
|
protected void |
setSortDirection(LoadContext.Query q)
Deprecated.
|
void |
suspendListeners()
Deprecated.
Suspend invocation of
collectionChanged method of registered CollectionDatasource.CollectionChangeListeners. |
void |
unmute(CollectionDatasource.UnmuteEventsMode mode)
Deprecated.
Enables all event listeners.
|
__setItem, committed, getDataSupplier, getDsContext, getItem, getItemIfValid, getMetaClass, getState, getView, initialized, invalidate, refresh, setDataSupplier, setDsContext, setMetaClass, setup, setView, setView, validaddItemChangeListener, addItemPropertyChangeListener, addParentsToNested, addStateChangeListener, attachListener, clearCommitLists, deleted, detachListener, enableListeners, fireItemChanged, fireStateChanged, getCommitMode, getEventRouter, getId, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getLoadDynamicAttributes, getParent, isAllowCommit, isModified, modified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setCommitMode, setLoadDynamicAttributes, setModified, setParent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddItem, clear, containsItem, excludeItem, getItem, getItemIds, getItems, includeItem, modifyItem, refresh, removeItem, revert, size, updateItemaddItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, getCommitMode, getDataSupplier, getDsContext, getId, getItem, getItemIfValid, getLoadDynamicAttributes, getMetaClass, getState, getView, invalidate, isAllowCommit, isModified, refresh, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setLoadDynamicAttributes, setupclearCommitLists, deleted, enableListeners, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getParent, modified, setCommitMode, setModified, setParentprotected java.lang.String query
protected QueryFilter filter
protected int maxResults
protected ParameterInfo[] queryParameters
protected boolean softDeletion
protected boolean cacheable
protected AbstractCollectionDatasource.ComponentValueListener componentValueListener
protected boolean refreshOnComponentValueChange
protected CollectionDatasource.Sortable.SortInfo<io.jmix.core.metamodel.model.MetaPropertyPath>[] sortInfos
protected java.util.Map<java.lang.String,java.lang.Object> savedParameters
protected java.lang.Throwable dataLoadError
protected boolean listenersSuspended
protected final java.util.LinkedList<CollectionDatasource.CollectionChangeEvent<T extends io.jmix.core.Entity,K>> suspendedEvents
protected CollectionDatasource.RefreshMode refreshMode
protected UserSession userSession
public T getItemNN(K id)
getItemNN in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setItem(T item)
DatasourcesetItem in interface Datasource<T extends io.jmix.core.Entity>setItem in class DatasourceImpl<T extends io.jmix.core.Entity>item - entity instancepublic java.lang.String getQuery()
getQuery in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public LoadContext getCompiledLoadContext() throws java.lang.UnsupportedOperationException
getCompiledLoadContext in interface CollectionDatasource<T extends io.jmix.core.Entity,K>java.lang.UnsupportedOperationExceptionpublic QueryFilter getQueryFilter()
getQueryFilter in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setQuery(java.lang.String query)
CollectionDatasourceds$ - current item in the specified datasource
component$ - value of the specified UI component
param$ - value of parameter passed to the window when opening it
session$ - userId represents current or substituted user ID,
userLogin represents current or substituted user login in lower case,
any other string represents a user session attribute with this name
custom$ - value of parameter passed to the CollectionDatasource.refresh(Map) method
setQuery in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setQueryFilter(QueryFilter filter)
CollectionDatasourceCollectionDatasource.setQuery(String) for the list of supported query parameters.setQueryFilter in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public int getMaxResults()
getMaxResults in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setMaxResults(int maxResults)
CollectionDatasourcesetMaxResults in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public java.util.Map<java.lang.String,java.lang.Object> getLastRefreshParameters()
CollectionDatasourceCollectionDatasource.refresh(Map) method or empty map if there was no refresh with parametersgetLastRefreshParameters in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public boolean getRefreshOnComponentValueChange()
CollectionDatasourcecomponent$ parameter)getRefreshOnComponentValueChange in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setRefreshOnComponentValueChange(boolean refresh)
CollectionDatasourcecomponent$ parameter)setRefreshOnComponentValueChange in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setQuery(java.lang.String query,
QueryFilter filter)
CollectionDatasourceCollectionDatasource.setQuery(String) for the list of supported query parameters.setQuery in interface CollectionDatasource<T extends io.jmix.core.Entity,K>protected java.util.Map<java.lang.String,java.lang.Object> getQueryParameters(java.util.Map<java.lang.String,java.lang.Object> params)
protected java.lang.String makeCaseInsensitive(java.lang.String value)
protected java.lang.String getJPQLQuery(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
protected void fireCollectionChanged(CollectionDatasource.Operation operation, java.util.List<T> items)
protected java.util.Map<java.lang.String,java.lang.Object> getTemplateParams(java.util.Map<java.lang.String,java.lang.Object> customParams)
public void suspendListeners()
CollectionDatasourcecollectionChanged method of registered CollectionDatasource.CollectionChangeListeners.
It makes sense in case of massive updates of the datasource by CollectionDatasource.addItem(Entity)
or similar methods.
After that, collectionChanged will be invoked once on CollectionDatasource.resumeListeners() call.
ds.suspendListeners();
try {
for (Object item : items) {
ds.addItem(item);
}
} finally {
ds.resumeListeners();
}
suspendListeners in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void resumeListeners()
CollectionDatasourcecollectionChanged method of registered CollectionDatasource.CollectionChangeListeners
after calling CollectionDatasource.suspendListeners().
It will call collectionChanged just once, doesn't matter how many updates were issued
since the previous CollectionDatasource.suspendListeners() call.
finally section.resumeListeners in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void mute()
CollectionDatasourceCollectionDatasource.unmute(UnmuteEventsMode) for bulk data modification as a performance optimization.mute in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void unmute(CollectionDatasource.UnmuteEventsMode mode)
CollectionDatasourceunmute in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public boolean isSoftDeletion()
isSoftDeletion in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setSoftDeletion(boolean softDeletion)
CollectionDatasourcesetSoftDeletion in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public boolean isCacheable()
isCacheable in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void setCacheable(boolean cacheable)
CollectionDatasourcesetCacheable in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void commit()
Datasourcecommit in interface Datasource<T extends io.jmix.core.Entity>commit in class DatasourceImpl<T extends io.jmix.core.Entity>protected java.util.Comparator<T> createEntityComparator()
protected io.jmix.core.DataLoadContextQuery createDataQuery(io.jmix.core.DataLoadContext context,
java.util.Map<java.lang.String,java.lang.Object> params)
public int getCount()
dataLoadError field to the exception objectprotected java.lang.String getLoggingTag(java.lang.String prefix)
protected void prepareLoadContext(LoadContext<?> context)
protected void checkDataLoadError()
protected void setSortDirection(LoadContext.Query q)
public CollectionDatasource.RefreshMode getRefreshMode()
getRefreshMode in interface CollectionDatasource.SupportsRefreshMode<T extends io.jmix.core.Entity,K>public void setRefreshMode(CollectionDatasource.RefreshMode refreshMode)
setRefreshMode in interface CollectionDatasource.SupportsRefreshMode<T extends io.jmix.core.Entity,K>public void addCollectionChangeListener(CollectionDatasource.CollectionChangeListener<? super T,K> listener)
addCollectionChangeListener in interface CollectionDatasource<T extends io.jmix.core.Entity,K>public void removeCollectionChangeListener(CollectionDatasource.CollectionChangeListener<? super T,K> listener)
removeCollectionChangeListener in interface CollectionDatasource<T extends io.jmix.core.Entity,K>