public class ValueCollectionDatasourceImpl extends CollectionDatasourceImpl<io.jmix.core.entity.KeyValueEntity,java.lang.Object> implements ValueDatasource
CollectionDatasource that supports KeyValueEntity.AbstractCollectionDatasource.ComponentValueListenerAbstractDatasource.ItemListenerCollectionDatasource.Sortable.Order, CollectionDatasource.Sortable.SortInfo<P>CollectionDatasource.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 ValueDatasourceDelegate |
delegate |
aggregatableDelegate, data, firstResult, inRefresh, lastQuery, prevQueries, queryKey, refreshOnResumeRequired, sortDelegate, sortOnDb, suspendedcacheable, componentValueListener, dataLoadError, filter, listenersSuspended, maxResults, query, queryParameters, refreshMode, refreshOnComponentValueChange, savedParameters, softDeletion, sortInfos, suspendedEvents, userSessiondataSupplier, dsContext, item, metaClass, state, viewallowCommit, backgroundWorker, commitMode, id, itemsToCreate, itemsToDelete, itemsToUpdate, listener, listenersEnabled, loadDynamicAttributes, metadata, modified, parentDs| Constructor and Description |
|---|
ValueCollectionDatasourceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(io.jmix.core.entity.KeyValueEntity item)
Add an item to the collection.
|
ValueCollectionDatasourceImpl |
addProperty(java.lang.String name)
Adds a string property to the meta-class of this datasource.
|
ValueCollectionDatasourceImpl |
addProperty(java.lang.String name,
java.lang.Class aClass)
Adds a property of the given Java class to the meta-class of this datasource.
|
ValueCollectionDatasourceImpl |
addProperty(java.lang.String name,
io.jmix.core.metamodel.datatype.Datatype datatype)
Adds a property of the given datatype to the meta-class of this datasource.
|
void |
includeItem(io.jmix.core.entity.KeyValueEntity item)
Include an item into the collection.
|
protected void |
loadData(java.util.Map<java.lang.String,java.lang.Object> params)
Load data from middleware into
CollectionDatasourceImpl.data field. |
ValueCollectionDatasourceImpl |
setIdName(java.lang.String name)
Sets the name of a property that represents the entity id.
|
void |
setStoreName(java.lang.String storeName) |
void |
setup(DsContext dsContext,
DataSupplier dataSupplier,
java.lang.String id,
io.jmix.core.metamodel.model.MetaClass metaClass,
io.jmix.core.FetchPlan view)
Setup the datasource right after creation.
|
addItemFirst, afterLoadData, afterRefresh, aggregate, aggregateValues, beforeLoadData, beforeRefresh, checkState, checkStateBeforeAdd, clear, committed, containsAllDataFromDb, containsItem, detachListener, doSort, excludeItem, firstItemId, getCompiledLoadContext, getFirstResult, getIdByIndex, getItem, getItemIds, getItemIds, getItems, getItemValue, includeItemFirst, incrementQueryKey, indexOfId, initAggregatableDelegate, internalAddItem, internalIncludeItem, isFirstId, isLastId, isSuspended, lastItemId, modifyItem, needLoading, nextItemId, pinQuery, prepareLoadContext, prevItemId, refresh, refresh, refreshIfNotSuspended, refreshIfNotSuspended, removeItem, resetSortOrder, revert, setFirstResult, setSortDelegate, setSuspended, size, sort, unpinAllQuery, unpinLastQuery, updateItemaddCollectionChangeListener, checkDataLoadError, commit, createDataQuery, createEntityComparator, fireCollectionChanged, getCount, getItemNN, getJPQLQuery, getLastRefreshParameters, getLoggingTag, getMaxResults, getQuery, getQueryFilter, getQueryParameters, getRefreshMode, getRefreshOnComponentValueChange, getTemplateParams, isCacheable, isSoftDeletion, makeCaseInsensitive, mute, removeCollectionChangeListener, resumeListeners, setCacheable, setItem, setMaxResults, setQuery, setQuery, setQueryFilter, setRefreshMode, setRefreshOnComponentValueChange, setSoftDeletion, setSortDirection, suspendListeners, unmute__setItem, getDataSupplier, getDsContext, getItem, getItemIfValid, getMetaClass, getState, getView, initialized, invalidate, setDataSupplier, setDsContext, setMetaClass, 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, waitgetMetaClassaddCollectionChangeListener, getItemNN, getLastRefreshParameters, getMaxResults, getQuery, getQueryFilter, getRefreshOnComponentValueChange, isCacheable, isSoftDeletion, mute, removeCollectionChangeListener, resumeListeners, setCacheable, setMaxResults, setQuery, setQuery, setQueryFilter, setRefreshOnComponentValueChange, setSoftDeletion, suspendListeners, unmuteaddItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, commit, getCommitMode, getDataSupplier, getDsContext, getId, getItem, getItemIfValid, getLoadDynamicAttributes, getMetaClass, getState, getView, invalidate, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setItem, setLoadDynamicAttributesgetCountclearCommitLists, deleted, enableListeners, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getParent, modified, setCommitMode, setModified, setParentprotected final ValueDatasourceDelegate delegate
public void setup(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, io.jmix.core.metamodel.model.MetaClass metaClass, @Nullable io.jmix.core.FetchPlan view)
Datasourcesetup in interface Datasource<io.jmix.core.entity.KeyValueEntity>setup in class DatasourceImpl<io.jmix.core.entity.KeyValueEntity>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 ValueCollectionDatasourceImpl setIdName(java.lang.String name)
ValueDatasourcesetIdName in interface ValueDatasourcepublic ValueCollectionDatasourceImpl addProperty(java.lang.String name)
ValueDatasourceaddProperty in interface ValueDatasourcepublic ValueCollectionDatasourceImpl addProperty(java.lang.String name, java.lang.Class aClass)
ValueDatasourceaddProperty in interface ValueDatasourcepublic ValueCollectionDatasourceImpl addProperty(java.lang.String name, io.jmix.core.metamodel.datatype.Datatype datatype)
ValueDatasourceaddProperty in interface ValueDatasourceprotected void loadData(java.util.Map<java.lang.String,java.lang.Object> params)
CollectionDatasourceImplCollectionDatasourceImpl.data field.
In case of error sets AbstractCollectionDatasource.dataLoadError field to the exception object.
loadData in class CollectionDatasourceImpl<io.jmix.core.entity.KeyValueEntity,java.lang.Object>params - datasource parameters, as described in CollectionDatasource.refresh(Map)public void includeItem(io.jmix.core.entity.KeyValueEntity item)
CollectionDatasourceincludeItem in interface CollectionDatasource<io.jmix.core.entity.KeyValueEntity,java.lang.Object>includeItem in class CollectionDatasourceImpl<io.jmix.core.entity.KeyValueEntity,java.lang.Object>public void addItem(io.jmix.core.entity.KeyValueEntity item)
CollectionDatasourceaddItem in interface CollectionDatasource<io.jmix.core.entity.KeyValueEntity,java.lang.Object>addItem in class CollectionDatasourceImpl<io.jmix.core.entity.KeyValueEntity,java.lang.Object>public void setStoreName(java.lang.String storeName)