public class ValueHierarchicalDatasourceImpl extends HierarchicalDatasourceImpl<KeyValueEntity,java.lang.Object> implements ValueDatasource
HierarchicalDatasource
that supports KeyValueEntity
.AbstractCollectionDatasource.ComponentValueListener
AbstractDatasource.ItemListener
CollectionDatasource.Aggregatable<T extends Entity<K>,K>, CollectionDatasource.CollectionChangeEvent<T extends Entity<K>,K>, CollectionDatasource.CollectionChangeListener<T extends Entity<K>,K>, CollectionDatasource.Indexed<T extends Entity<K>,K>, CollectionDatasource.Lazy<T extends Entity<K>,K>, CollectionDatasource.Operation, CollectionDatasource.Ordered<T extends Entity<K>,K>, CollectionDatasource.RefreshMode, CollectionDatasource.Sortable<T extends Entity<K>,K>, CollectionDatasource.SupportsApplyToSelected<T extends Entity<K>,K>, CollectionDatasource.SupportsPaging<T extends Entity<K>,K>, CollectionDatasource.SupportsRefreshMode<T extends Entity<K>,K>, CollectionDatasource.Suspendable<T extends Entity<K>,K>, CollectionDatasource.UnmuteEventsMode
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>
CollectionDatasource.Sortable.Order, CollectionDatasource.Sortable.SortInfo<P>
Modifier and Type | Field and Description |
---|---|
protected ValueDatasourceDelegate |
delegate |
hierarchyPropertyName
aggregatableDelegate, data, firstResult, inRefresh, lastQuery, prevQueries, queryKey, refreshOnResumeRequired, sortOnDb, suspended
cacheable, componentValueListener, dataLoadError, filter, listenersSuspended, maxResults, query, queryParameters, refreshMode, refreshOnComponentValueChange, savedParameters, softDeletion, sortInfos, suspendedEvents, userSession
dataSupplier, dsContext, item, metaClass, state, view
allowCommit, backgroundWorker, commitMode, id, itemsToCreate, itemsToDelete, itemsToUpdate, listener, listenersEnabled, loadDynamicAttributes, metadata, modified, parentDs
Constructor and Description |
---|
ValueHierarchicalDatasourceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(KeyValueEntity item)
Add an item to the collection.
|
ValueHierarchicalDatasourceImpl |
addProperty(java.lang.String name)
Adds a string property to the meta-class of this datasource.
|
ValueHierarchicalDatasourceImpl |
addProperty(java.lang.String name,
java.lang.Class aClass)
Adds a property of the given Java class to the meta-class of this datasource.
|
ValueHierarchicalDatasourceImpl |
addProperty(java.lang.String name,
com.haulmont.chile.core.datatypes.Datatype datatype)
Adds a property of the given datatype to the meta-class of this datasource.
|
void |
includeItem(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. |
void |
setHierarchyPropertyName(java.lang.String hierarchyPropertyName)
Set property of entity which forms the hierarchy
|
ValueHierarchicalDatasourceImpl |
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,
com.haulmont.chile.core.model.MetaClass metaClass,
View view)
Setup the datasource right after creation.
|
getChildren, getHierarchyPropertyName, getParent, getRootItemIds, hasChildren, isRoot
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, internalAddItem, internalIncludeItem, isFirstId, isLastId, isSuspended, lastItemId, modifyItem, needLoading, nextItemId, pinQuery, prepareLoadContext, prevItemId, refresh, refresh, refreshIfNotSuspended, refreshIfNotSuspended, removeItem, resetSortOrder, revert, setFirstResult, setSuspended, size, sort, unpinAllQuery, unpinLastQuery, updateItem
addCollectionChangeListener, checkDataLoadError, commit, createDataQuery, createEntityComparator, fireCollectionChanged, getCount, getItemNN, getJPQLQuery, getLastRefreshParameters, getLoggingTag, getMaxResults, getQuery, getQueryFilter, getQueryParameters, getRefreshMode, getRefreshOnComponentValueChange, getSortPropertiesForPersistentAttribute, 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, valid
addItemChangeListener, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMetaClass
addCollectionChangeListener, clear, containsItem, excludeItem, getCompiledLoadContext, getItem, getItemIds, getItemNN, getItems, getLastRefreshParameters, getMaxResults, getQuery, getQueryFilter, getRefreshOnComponentValueChange, isCacheable, isSoftDeletion, modifyItem, mute, refresh, removeCollectionChangeListener, removeItem, resumeListeners, revert, setCacheable, setMaxResults, setQuery, setQuery, setQueryFilter, setRefreshOnComponentValueChange, setSoftDeletion, size, suspendListeners, unmute, updateItem
addItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, commit, getCommitMode, getDataSupplier, getDsContext, getId, getItem, getItemIfValid, getLoadDynamicAttributes, getMetaClass, getState, getView, invalidate, isAllowCommit, isModified, refresh, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setItem, setLoadDynamicAttributes
getCount
clearCommitLists, deleted, enableListeners, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getParent, modified, setCommitMode, setModified, setParent
protected final ValueDatasourceDelegate delegate
public void setup(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, com.haulmont.chile.core.model.MetaClass metaClass, @Nullable View view)
Datasource
setup
in interface Datasource<KeyValueEntity>
setup
in class DatasourceImpl<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 ValueHierarchicalDatasourceImpl setIdName(java.lang.String name)
ValueDatasource
setIdName
in interface ValueDatasource
public ValueHierarchicalDatasourceImpl addProperty(java.lang.String name)
ValueDatasource
addProperty
in interface ValueDatasource
public ValueHierarchicalDatasourceImpl addProperty(java.lang.String name, java.lang.Class aClass)
ValueDatasource
addProperty
in interface ValueDatasource
public ValueHierarchicalDatasourceImpl addProperty(java.lang.String name, com.haulmont.chile.core.datatypes.Datatype datatype)
ValueDatasource
addProperty
in interface ValueDatasource
public void setHierarchyPropertyName(java.lang.String hierarchyPropertyName)
HierarchicalDatasource
setHierarchyPropertyName
in interface HierarchicalDatasource<KeyValueEntity,java.lang.Object>
setHierarchyPropertyName
in class HierarchicalDatasourceImpl<KeyValueEntity,java.lang.Object>
protected void loadData(java.util.Map<java.lang.String,java.lang.Object> params)
CollectionDatasourceImpl
CollectionDatasourceImpl.data
field.
In case of error sets AbstractCollectionDatasource.dataLoadError
field to the exception object.
loadData
in class CollectionDatasourceImpl<KeyValueEntity,java.lang.Object>
params
- datasource parameters, as described in CollectionDatasource.refresh(java.util.Map)
public void includeItem(KeyValueEntity item)
CollectionDatasource
includeItem
in interface CollectionDatasource<KeyValueEntity,java.lang.Object>
includeItem
in class CollectionDatasourceImpl<KeyValueEntity,java.lang.Object>
public void addItem(KeyValueEntity item)
CollectionDatasource
addItem
in interface CollectionDatasource<KeyValueEntity,java.lang.Object>
addItem
in class CollectionDatasourceImpl<KeyValueEntity,java.lang.Object>
public void setStoreName(java.lang.String storeName)