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
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected Stringprotected DynAttrMetadataprotected EntityStatesprotected ExtendedEntitiesprotected FetchPlanRepositoryprotected FetchPlansstatic final intprotected Metadataprotected MetadataToolsprotected ReferenceToEntitySupportprotected StoreAwareLocator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDynamicAttributesState(Collection<Object> entities, FetchPlan fetchPlan) Adds extra state for each entity and related entities based on thefetchPlancollectEntitiesToLoad(Collection<Object> entities, FetchPlan fetchPlan) collectEntityClasses(FetchPlan fetchPlan, Set<FetchPlan> visited) protected voiddoFetchValues(MetaClass metaClass, Collection<Object> entities, Collection<AccessConstraint<?>> accessConstraints) protected voiddoStoreCollectionValue(CategoryAttributeValue collectionAttributeValue) Removes nestedCategoryAttributeValueentities for items that were removed from the collection value and creates new childCategoryAttributeValueinstances for just added collection value items.protected voiddoStoreValues(Object entity, Collection<AccessConstraint<?>> accessConstraints) protected List<CategoryAttributeValue>protected voidfetchEntityValues(Collection<AccessConstraint<?>> accessConstraints, List<CategoryAttributeValue> values) Method loads entity values for CategoryAttributeValues of entity type and sets entity values to the corresponding property of theCategoryAttributeValueentity.protected List<CategoryAttributeValue>findValuesByEntityIds(MetaClass metaClass, List<Object> entityIds) protected List<CategoryAttributeValue>loadValues(MetaClass metaClass, Collection<AccessConstraint<?>> accessConstraints, List<Object> entityIds) voidloadValues(Collection<Object> entities, FetchPlan fetchPlan, Collection<AccessConstraint<?>> accessConstraints) Fetch dynamic attributes from dynamic attributes store for each entityprotected voidvoidstoreValues(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:DynAttrManagerStore dynamic attributes from the entity to store- Specified by:
storeValuesin interfaceDynAttrManager
-
loadValues
public void loadValues(Collection<Object> entities, @Nullable FetchPlan fetchPlan, Collection<AccessConstraint<?>> accessConstraints) Description copied from interface:DynAttrManagerFetch dynamic attributes from dynamic attributes store for each entity- Specified by:
loadValuesin interfaceDynAttrManager
-
addDynamicAttributesState
Description copied from interface:DynAttrManagerAdds extra state for each entity and related entities based on thefetchPlan- Specified by:
addDynamicAttributesStatein interfaceDynAttrManager
-
doStoreValues
-
doStoreCollectionValue
Removes nestedCategoryAttributeValueentities for items that were removed from the collection value and creates new childCategoryAttributeValueinstances 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 theCategoryAttributeValueentity. -
fetchCollectionValues
-
collectEntitiesToLoad
protected com.google.common.collect.Multimap<MetaClass,Object> collectEntitiesToLoad(Collection<Object> entities, @Nullable FetchPlan fetchPlan) -
collectEntityClasses
-
setValueToCategoryAttributeValue
-