Package io.jmix.dynattr.impl
Class DynAttrManagerImpl
java.lang.Object
io.jmix.dynattr.impl.DynAttrManagerImpl
- All Implemented Interfaces:
DynAttrManager
@Component("dynat_DynamicModelManager")
public class DynAttrManagerImpl
extends Object
implements DynAttrManager
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected String
protected DynAttrMetadata
protected EntityStates
protected ExtendedEntities
protected FetchPlanRepository
protected FetchPlans
static final int
protected Metadata
protected MetadataTools
protected ReferenceToEntitySupport
protected StoreAwareLocator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDynamicAttributesState
(Collection<Object> entities, FetchPlan fetchPlan) Adds extra state for each entity and related entities based on thefetchPlan
collectEntitiesToLoad
(Collection<Object> entities, FetchPlan fetchPlan) collectEntityClasses
(FetchPlan fetchPlan, Set<FetchPlan> visited) protected void
doFetchValues
(MetaClass metaClass, Collection<Object> entities, Collection<AccessConstraint<?>> accessConstraints) protected void
doStoreCollectionValue
(CategoryAttributeValue collectionAttributeValue) Removes nestedCategoryAttributeValue
entities for items that were removed from the collection value and creates new childCategoryAttributeValue
instances for just added collection value items.protected void
doStoreValues
(Object entity, Collection<AccessConstraint<?>> accessConstraints) protected List<CategoryAttributeValue>
protected void
fetchEntityValues
(Collection<AccessConstraint<?>> accessConstraints, List<CategoryAttributeValue> values) Method loads entity values for CategoryAttributeValues of entity type and sets entity values to the corresponding property of theCategoryAttributeValue
entity.protected List<CategoryAttributeValue>
findValuesByEntityIds
(MetaClass metaClass, List<Object> entityIds) protected List<CategoryAttributeValue>
loadValues
(MetaClass metaClass, Collection<AccessConstraint<?>> accessConstraints, List<Object> entityIds) void
loadValues
(Collection<Object> entities, FetchPlan fetchPlan, Collection<AccessConstraint<?>> accessConstraints) Fetch dynamic attributes from dynamic attributes store for each entityprotected void
void
storeValues
(Collection<Object> entities, Collection<AccessConstraint<?>> accessConstraints) Store dynamic attributes from the entity to store
-
Field Details
-
MAX_ENTITIES_FOR_ATTRIBUTE_VALUES_BATCH
public static final int MAX_ENTITIES_FOR_ATTRIBUTE_VALUES_BATCH- See Also:
-
storeAwareLocator
-
metadata
-
metadataTools
-
extendedEntities
-
referenceToEntitySupport
-
entityStates
-
dynAttrMetadata
-
fetchPlanRepository
-
fetchPlans
-
accessManager
-
dynamicAttributesStore
-
-
Constructor Details
-
DynAttrManagerImpl
public DynAttrManagerImpl()
-
-
Method Details
-
storeValues
public void storeValues(Collection<Object> entities, Collection<AccessConstraint<?>> accessConstraints) Description copied from interface:DynAttrManager
Store dynamic attributes from the entity to store- Specified by:
storeValues
in interfaceDynAttrManager
-
loadValues
public void loadValues(Collection<Object> entities, @Nullable FetchPlan fetchPlan, Collection<AccessConstraint<?>> accessConstraints) Description copied from interface:DynAttrManager
Fetch dynamic attributes from dynamic attributes store for each entity- Specified by:
loadValues
in interfaceDynAttrManager
-
addDynamicAttributesState
Description copied from interface:DynAttrManager
Adds extra state for each entity and related entities based on thefetchPlan
- Specified by:
addDynamicAttributesState
in interfaceDynAttrManager
-
doStoreValues
-
doStoreCollectionValue
Removes nestedCategoryAttributeValue
entities for items that were removed from the collection value and creates new childCategoryAttributeValue
instances for just added collection value items.- Parameters:
collectionAttributeValue
-
-
doFetchValues
protected void doFetchValues(MetaClass metaClass, Collection<Object> entities, Collection<AccessConstraint<?>> accessConstraints) -
loadValues
protected List<CategoryAttributeValue> loadValues(MetaClass metaClass, Collection<AccessConstraint<?>> accessConstraints, List<Object> entityIds) -
findValuesByEntityIds
protected List<CategoryAttributeValue> findValuesByEntityIds(MetaClass metaClass, List<Object> entityIds) -
fetchEntityValues
protected void fetchEntityValues(Collection<AccessConstraint<?>> accessConstraints, List<CategoryAttributeValue> values) Method loads entity values for CategoryAttributeValues of entity type and sets entity values to the corresponding property of theCategoryAttributeValue
entity. -
fetchCollectionValues
-
collectEntitiesToLoad
protected com.google.common.collect.Multimap<MetaClass,Object> collectEntitiesToLoad(Collection<Object> entities, @Nullable FetchPlan fetchPlan) -
collectEntityClasses
-
setValueToCategoryAttributeValue
-