@Repository(value="blMultiTenantProductDao") public class MultiTenantProductDaoImpl extends Object implements MultiTenantProductDao
MultiTenantProductDao| Modifier and Type | Field and Description |
|---|---|
protected static String |
CACHE_NAME |
protected javax.cache.CacheManager |
cacheManager |
protected javax.persistence.EntityManager |
em |
protected org.broadleafcommerce.common.dao.GenericEntityDao |
genericEntityDao |
protected boolean |
includeProductionIndexOptimization |
protected org.broadleafcommerce.common.logging.SupportLogger |
logger |
protected javax.cache.Cache<Object,Object> |
productOverrideCache |
protected com.broadleafcommerce.enterprise.common.extension.tenant.RelationshipOverridesExtensionManager |
relationOverrideExtensionManager |
protected com.broadleafcommerce.enterprise.common.extension.tenant.RelationshipOverridesUtil |
relationshipUtil |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
transUtil |
protected boolean |
useGlobalSolrProductOverrideCache |
| Constructor and Description |
|---|
MultiTenantProductDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected Map<Long,Set<Long>> |
buildUpOverriddenCatalogs(Class<?> type,
javax.persistence.TypedQuery<Long> countQuery,
javax.persistence.Query typeQuery,
javax.persistence.Query catalogQuery)
Execute queries to retrieve standard site overridden catalogs and build up the overrides map for a particular type.
|
protected Map<Long,Set<Long>> |
buildUpProductRelationOverrides(Map<Long,Set<Long>> overrides,
Map<Long,Set<Long>> skuRelOverrides)
Discover any relationship overrides to the provided overrides for the base entity.
|
protected Map<Long,Set<Long>> |
buildUpSkuRelationOverrides(Map<Long,Set<Long>> overrides) |
protected javax.cache.Cache<Object,Object> |
getCache() |
protected javax.cache.CacheManager |
getCacheManager() |
protected Map<String,Map<Long,Set<Long>>> |
getGlobalOverrideCache()
This cache strategy employs an in-memory cache per cluster node.
|
protected Map<String,Map<Long,Set<Long>>> |
getLocalOverrideCache()
The default cache strategy.
|
Map<String,Map<Long,Set<Long>>> |
getOverrideCache()
Get a cached map that identifies standard site catalog ids that contain entity overrides for a template catalog entity.
|
protected Map<Long,Set<Long>> |
getOverrideCatalogsForType(Class<?> requestedType)
For the specified type, find all standard site catalogs that have an overridden version of the type.
|
Collection<Long> |
getProductionOverriddenCatalogIds(org.broadleafcommerce.core.catalog.domain.Indexable indexable)
For the given master template indexable, returns a list of Catalog IDs that have an overridden version of
said indexable in production.
|
Collection<Long> |
getProductionOverriddenCatalogIdsOnlyInRelationships(org.broadleafcommerce.core.catalog.domain.Product product)
Similar idea as
MultiTenantProductDao.getProductionOverriddenCatalogIdsOnlyInRelationships(Product) except that this is only for
relationships of the given product (like CategoryProductXref). |
protected Map<Long,Set<Long>> |
getProductOverriddenCatalogsForSkus(Map<Long,Set<Long>> skuOverrides) |
void |
init() |
void |
updateGlobalOverrideCache(Long productId) |
protected static final String CACHE_NAME
protected org.broadleafcommerce.common.logging.SupportLogger logger
@Value(value="${sandbox.include.deleted.items.production.optimization:false}")
protected boolean includeProductionIndexOptimization
protected javax.persistence.EntityManager em
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
protected org.broadleafcommerce.common.dao.GenericEntityDao genericEntityDao
protected com.broadleafcommerce.enterprise.common.extension.tenant.RelationshipOverridesUtil relationshipUtil
protected com.broadleafcommerce.enterprise.common.extension.tenant.RelationshipOverridesExtensionManager relationOverrideExtensionManager
protected javax.cache.CacheManager cacheManager
@Value(value="${use.global.solr.product.override.cache:false}")
protected boolean useGlobalSolrProductOverrideCache
@PostConstruct public void init()
public Collection<Long> getProductionOverriddenCatalogIds(org.broadleafcommerce.core.catalog.domain.Indexable indexable)
MultiTenantProductDaoFor the given master template indexable, returns a list of Catalog IDs that have an overridden version of said indexable in production.
So given this scenario:
Given another scenario:
This will look both at the clones of the given indexable as well as clones in relationships where the indexable itself would not have been cloned
getProductionOverriddenCatalogIds in interface MultiTenantProductDaoindexable - from the parent catalog to find overrides forpublic Collection<Long> getProductionOverriddenCatalogIdsOnlyInRelationships(org.broadleafcommerce.core.catalog.domain.Product product)
MultiTenantProductDaoMultiTenantProductDao.getProductionOverriddenCatalogIdsOnlyInRelationships(Product) except that this is only for
relationships of the given product (like CategoryProductXref). This is useful because if a change
occurs in one of these relationships the Product does not actually get cloned, only the relationship.getProductionOverriddenCatalogIdsOnlyInRelationships in interface MultiTenantProductDao#getProductionOverriddenCatalogIds(Indexable)}public Map<String,Map<Long,Set<Long>>> getOverrideCache()
MultiTenantProductDaogetOverrideCache in interface MultiTenantProductDaopublic void updateGlobalOverrideCache(Long productId)
protected Map<String,Map<Long,Set<Long>>> getLocalOverrideCache()
cacheSku - protected Map<Long,Set<Long>> getProductOverriddenCatalogsForSkus(Map<Long,Set<Long>> skuOverrides)
protected Map<String,Map<Long,Set<Long>>> getGlobalOverrideCache()
cacheSku - protected Map<Long,Set<Long>> buildUpProductRelationOverrides(Map<Long,Set<Long>> overrides, Map<Long,Set<Long>> skuRelOverrides)
Discover any relationship overrides to the provided overrides for the base entity. This would apply, for example, to any changes to CategoryProductXrefImpl which should be added to the list of overrides for ProductImpl. Subclasses may override and add more relationship overrides if additional relationships are being considered as part of the solr indexing.
overrides - the overrides for the base entity (e.g. ProductImpl)RelationshipOverridesExtensionHandler#getRelationshipOverrideCatalogsForProducts(ExtensionResultHolder)}protected Map<Long,Set<Long>> buildUpSkuRelationOverrides(Map<Long,Set<Long>> overrides)
protected Map<Long,Set<Long>> getOverrideCatalogsForType(Class<?> requestedType)
requestedType - The entity class type to checkprotected Map<Long,Set<Long>> buildUpOverriddenCatalogs(Class<?> type, javax.persistence.TypedQuery<Long> countQuery, javax.persistence.Query typeQuery, javax.persistence.Query catalogQuery)
type - the type to retrieve from the clone cachecountQuery - the count query for items in the clone cache (used for paging)typeQuery - the query to retrieve items from the clone cachecatalogQuery - the query to retrieve the overridden catalogsprotected javax.cache.CacheManager getCacheManager()
Copyright © 2020. All rights reserved.