@Repository(value="blMultiTenantDao") public class MultiTenantDaoImpl extends Object implements MultiTenantDao
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
em |
| Constructor and Description |
|---|
MultiTenantDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyParameterizedAssociatedSubqueryRestrictions(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.Subquery<Long> subquery,
javax.persistence.criteria.Root<org.broadleafcommerce.common.site.domain.SiteCatalogXrefImpl> siteCatalogRoot,
boolean alwaysAllowAdminStatus) |
void |
completeParameterizedAssociatedCatalogSubQuery(javax.persistence.Query query,
org.broadleafcommerce.common.site.domain.Site currentSite)
Set the currentSite parameter on the catalog sub query.
|
Long |
countAllManagedSites(Long parentSiteId) |
List<org.broadleafcommerce.common.site.domain.Catalog> |
findAllCatalogs() |
List<org.broadleafcommerce.common.site.domain.Catalog> |
findAllCatalogs(boolean excludeArchived) |
List<org.broadleafcommerce.common.site.domain.Site> |
findAllManagedProfiles(Long profileId)
Find all standard sites whose base profile matches the passed in id
|
List<org.broadleafcommerce.common.site.domain.Site> |
findAllManagedSites(Long parentSiteId)
Find any standard sites whose parent matches the passed in id
|
List<org.broadleafcommerce.common.site.domain.Site> |
findAllManagedSites(Long parentSiteId,
Integer limit,
Integer offset)
Paged version of
MultiTenantDao.findAllManagedSites(Long) |
List<org.broadleafcommerce.common.site.domain.Catalog> |
findAllStandardSiteCatalogs() |
List<MultiTenantSite> |
findAllStandardSites()
Finds all standard sites
|
List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> |
findCatalogAssociationsById(Long siteId,
Long catalogId)
Find the association with the specific catalog id
|
List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> |
findCatalogAssociationsByName(Long siteId,
String catalogName)
Find the association with the specific catalog name
|
org.broadleafcommerce.common.site.domain.Catalog |
findCatalogById(Long catalogId)
Find
Catalog by Id |
List<CatalogDerivedCatalogXref> |
findCatalogXrefsForCatalog(org.broadleafcommerce.common.site.domain.Catalog catalog)
Find
CatalogDerivedCatalogXref for the passed in catalog. |
List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> |
findCatalogXrefsForSite(org.broadleafcommerce.common.site.domain.Site site)
Find
SiteCatalogXref for the passed in site. |
List<Long> |
findDefaultCatalogIdsByAssignedCatalogId(Long assignedCatalogId)
Find the default catalogs for sites that are assigned the given catalog.
|
List<org.broadleafcommerce.common.site.domain.Site> |
findDerivedSitesFromCatalogs(List<Long> parentCatalogs)
Find
Site instances whose catalogs have this catalog
as a parent. |
List<org.broadleafcommerce.common.site.domain.Site> |
findDerivedSitesFromProfiles(List<Long> parentProfiles)
Find
Site instances whose profile have this profile
as a parent. |
List<MultiTenantSite> |
findManagedProfileSites(Long parentSiteId)
Find any profile sites whose parent matches the passed in id
|
org.broadleafcommerce.common.site.domain.Catalog |
findOwnedCatalog(Long siteId,
Long catalogId)
If the candidate catalog is owned by the current site, return it.
|
List<Long> |
findSiteCatalogIdsByAssignedCatalogId(Long assignedCatalogId)
Find the catalogs that hold site overrides or synced copies for this assigned catalog's id.
|
org.broadleafcommerce.common.site.domain.SiteCatalogXref |
findSiteCatalogXref(Long id)
Find the xref, if exists, for the given site and catalog
|
List<MultiTenantSite> |
findStandardSitesForAssignedCatalog(Long assignedCatalogId)
Find any standard sites who have the designated catalog assigned
|
javax.persistence.criteria.Subquery<Long> |
getAssociatedCatalogSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery criteria)
Provide a criteria builder subquery (useful for placing in an IN clause) that will retrieve the distinct list of
catalogs assigned to a site.
|
javax.persistence.criteria.Subquery<Long> |
getAssociatedSiteSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery criteria,
boolean alwaysAllowAdminStatus)
Provide a criteria builder subquery (useful for placing in an IN clause) that will retrieve the distinct list of
owning sites for all catalogs assigned to a site.
|
protected List<javax.persistence.criteria.Predicate> |
getAssociatedSubqueryRestrictions(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.Subquery<Long> subquery,
javax.persistence.criteria.Root<org.broadleafcommerce.common.site.domain.SiteCatalogXrefImpl> siteCatalogRoot,
boolean alwaysAllowAdminStatus) |
javax.persistence.criteria.Subquery<Long> |
getOwnedCatalogsSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery criteria)
Similar to
MultiTenantDao.getAssociatedCatalogSubQuery(Site, CriteriaBuilder, CriteriaQuery) except that this places a further restriction on
only retrieving the associated catalogs that are also owned by the currentSite |
javax.persistence.criteria.Subquery<Long> |
getParameterizedAssociatedCatalogSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery criteria)
Same as
MultiTenantDao.getAssociatedCatalogSubQuery(Site, CriteriaBuilder, CriteriaQuery), except that the subquery
returns uses a parameter for the currentSite. |
org.broadleafcommerce.common.site.domain.Catalog |
getTargetCatalogBasedOnMutability(Long candidateCatalogId,
Long siteId)
Get the current catalog context based on a candidate catalog.
|
Boolean |
isCatalogUsedByChildSites(Long parentSiteId,
Long catalogId)
Whether the catalog of the passed in id is assigned to children of the passed in parent site id
|
Boolean |
isMultipleManagedCatalogs(Long siteId)
Determine, in a performant way, whether or not the current site is managing more than one active catalog
|
Boolean |
isMultipleManagedCatalogsEligibleForAdd(Long siteId)
Determine, in a performant way, whether or not the current site is managing more than one active and eligible for
add catalog.
|
CatalogDerivedCatalogXref |
readDerivedCatalogXrefById(Long id)
Finds a given
CatalogDerivedCatalogXref entity by its id |
List<org.broadleafcommerce.common.site.domain.Site> |
retrieveChildrenSitesByParentSiteId(Long id)
Retrieves a list of children sites for the site id passed in
|
CatalogDerivedCatalogXref |
saveDerivedCatalogXref(CatalogDerivedCatalogXref xref)
Persists the given
CatalogDerivedCatalogXref entity to the database. |
public List<org.broadleafcommerce.common.site.domain.Site> findDerivedSitesFromCatalogs(List<Long> parentCatalogs)
MultiTenantDaoSite instances whose catalogs have this catalog
as a parent.findDerivedSitesFromCatalogs in interface MultiTenantDaoparentCatalogs - the catalog on which a derived site's catalog is basedpublic List<org.broadleafcommerce.common.site.domain.Site> findDerivedSitesFromProfiles(List<Long> parentProfiles)
MultiTenantDaoSite instances whose profile have this profile
as a parent.findDerivedSitesFromProfiles in interface MultiTenantDaoparentProfiles - the profile on which a derived site's profile is basedpublic List<MultiTenantSite> findStandardSitesForAssignedCatalog(Long assignedCatalogId)
MultiTenantDaofindStandardSitesForAssignedCatalog in interface MultiTenantDaopublic List<MultiTenantSite> findManagedProfileSites(Long parentSiteId)
MultiTenantDaofindManagedProfileSites in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Site> findAllManagedSites(Long parentSiteId)
MultiTenantDaofindAllManagedSites in interface MultiTenantDao#findAllManagedSites(Long, Integer, Integer)}public List<org.broadleafcommerce.common.site.domain.Site> findAllManagedSites(Long parentSiteId, Integer limit, Integer offset)
MultiTenantDaoMultiTenantDao.findAllManagedSites(Long)findAllManagedSites in interface MultiTenantDaolimit - how many results to limitoffset - where to start the result set#findAllManagedSites(Long, Integer, Integer)}public Long countAllManagedSites(Long parentSiteId)
countAllManagedSites in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Site> findAllManagedProfiles(Long profileId)
MultiTenantDaofindAllManagedProfiles in interface MultiTenantDaopublic Boolean isCatalogUsedByChildSites(Long parentSiteId, Long catalogId)
MultiTenantDaoisCatalogUsedByChildSites in interface MultiTenantDaopublic Boolean isMultipleManagedCatalogs(Long siteId)
MultiTenantDaoisMultipleManagedCatalogs in interface MultiTenantDaopublic Boolean isMultipleManagedCatalogsEligibleForAdd(Long siteId)
MultiTenantDaoisMultipleManagedCatalogsEligibleForAdd in interface MultiTenantDaopublic org.broadleafcommerce.common.site.domain.Catalog findOwnedCatalog(Long siteId, Long catalogId)
MultiTenantDaofindOwnedCatalog in interface MultiTenantDaopublic org.broadleafcommerce.common.site.domain.Catalog findCatalogById(Long catalogId)
MultiTenantDaoCatalog by IdfindCatalogById in interface MultiTenantDaocatalogId - of the catalog to find.public List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> findCatalogXrefsForSite(org.broadleafcommerce.common.site.domain.Site site)
MultiTenantDaoSiteCatalogXref for the passed in site.findCatalogXrefsForSite in interface MultiTenantDaopublic List<Long> findSiteCatalogIdsByAssignedCatalogId(Long assignedCatalogId)
MultiTenantDaofindSiteCatalogIdsByAssignedCatalogId in interface MultiTenantDaoassignedCatalogId - usually the id of a TEMPLATE Site-level Catalog.public List<Long> findDefaultCatalogIdsByAssignedCatalogId(Long assignedCatalogId)
MultiTenantDaofindDefaultCatalogIdsByAssignedCatalogId in interface MultiTenantDaoassignedCatalogId - usually the id of a TEMPLATE Site-level Catalog.public List<CatalogDerivedCatalogXref> findCatalogXrefsForCatalog(org.broadleafcommerce.common.site.domain.Catalog catalog)
MultiTenantDaoCatalogDerivedCatalogXref for the passed in catalog.findCatalogXrefsForCatalog in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Catalog> findAllStandardSiteCatalogs()
findAllStandardSiteCatalogs in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Catalog> findAllCatalogs()
findAllCatalogs in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Catalog> findAllCatalogs(boolean excludeArchived)
findAllCatalogs in interface MultiTenantDaopublic CatalogDerivedCatalogXref readDerivedCatalogXrefById(Long id)
MultiTenantDaoCatalogDerivedCatalogXref entity by its idreadDerivedCatalogXrefById in interface MultiTenantDaoCatalogDerivedCatalogXrefpublic org.broadleafcommerce.common.site.domain.SiteCatalogXref findSiteCatalogXref(Long id)
MultiTenantDaofindSiteCatalogXref in interface MultiTenantDaopublic CatalogDerivedCatalogXref saveDerivedCatalogXref(CatalogDerivedCatalogXref xref)
MultiTenantDaoCatalogDerivedCatalogXref entity to the database.saveDerivedCatalogXref in interface MultiTenantDaoCatalogDerivedCatalogXrefpublic List<MultiTenantSite> findAllStandardSites()
MultiTenantDaofindAllStandardSites in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.Site> retrieveChildrenSitesByParentSiteId(Long id)
MultiTenantDaoretrieveChildrenSitesByParentSiteId in interface MultiTenantDaopublic javax.persistence.criteria.Subquery<Long> getAssociatedSiteSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.CriteriaQuery criteria, boolean alwaysAllowAdminStatus)
MultiTenantDaogetAssociatedSiteSubQuery in interface MultiTenantDaocurrentSite - the site whose assigned catalogs are reviewedbuilder - the CriteriaBuilder from the containing criteria creationcriteria - the CriteriaQuery from the containing criteria creationalwaysAllowAdminStatus - whether or not calls should allow both PENDING and ONLINE catalog associations, regardless of the request context statepublic javax.persistence.criteria.Subquery<Long> getAssociatedCatalogSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.CriteriaQuery criteria)
MultiTenantDaogetAssociatedCatalogSubQuery in interface MultiTenantDaocurrentSite - the site whose assigned catalogs are reviewedbuilder - the CriteriaBuilder from the containing criteria creationcriteria - the CriteriaQuery from the containing criteria creationpublic javax.persistence.criteria.Subquery<Long> getOwnedCatalogsSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.CriteriaQuery criteria)
MultiTenantDaoMultiTenantDao.getAssociatedCatalogSubQuery(Site, CriteriaBuilder, CriteriaQuery) except that this places a further restriction on
only retrieving the associated catalogs that are also owned by the currentSitegetOwnedCatalogsSubQuery in interface MultiTenantDaocurrentSite - the site whose assigned catalogs are reviewedbuilder - the CriteriaBuilder from the containing criteria creationcriteria - the CriteriaQuery from the containing criteria creationpublic javax.persistence.criteria.Subquery<Long> getParameterizedAssociatedCatalogSubQuery(org.broadleafcommerce.common.site.domain.Site currentSite, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.CriteriaQuery criteria)
MultiTenantDaoMultiTenantDao.getAssociatedCatalogSubQuery(Site, CriteriaBuilder, CriteriaQuery), except that the subquery
returns uses a parameter for the currentSite. The final Query instance should be passed to MultiTenantDao.completeParameterizedAssociatedCatalogSubQuery(Query, Site).getParameterizedAssociatedCatalogSubQuery in interface MultiTenantDaopublic void completeParameterizedAssociatedCatalogSubQuery(javax.persistence.Query query,
org.broadleafcommerce.common.site.domain.Site currentSite)
MultiTenantDaocompleteParameterizedAssociatedCatalogSubQuery in interface MultiTenantDaopublic org.broadleafcommerce.common.site.domain.Catalog getTargetCatalogBasedOnMutability(Long candidateCatalogId, Long siteId)
MultiTenantDaogetTargetCatalogBasedOnMutability in interface MultiTenantDaocandidateCatalogId - the candidate catalog (presumably taken from a catalog discriminated entity)siteId - the current sitepublic List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> findCatalogAssociationsById(Long siteId, Long catalogId)
MultiTenantDaofindCatalogAssociationsById in interface MultiTenantDaopublic List<org.broadleafcommerce.common.site.domain.SiteCatalogXref> findCatalogAssociationsByName(Long siteId, String catalogName)
MultiTenantDaofindCatalogAssociationsByName in interface MultiTenantDaoprotected List<javax.persistence.criteria.Predicate> getAssociatedSubqueryRestrictions(org.broadleafcommerce.common.site.domain.Site currentSite, javax.persistence.criteria.CriteriaBuilder builder, javax.persistence.criteria.Subquery<Long> subquery, javax.persistence.criteria.Root<org.broadleafcommerce.common.site.domain.SiteCatalogXrefImpl> siteCatalogRoot, boolean alwaysAllowAdminStatus)
protected void applyParameterizedAssociatedSubqueryRestrictions(org.broadleafcommerce.common.site.domain.Site currentSite,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.Subquery<Long> subquery,
javax.persistence.criteria.Root<org.broadleafcommerce.common.site.domain.SiteCatalogXrefImpl> siteCatalogRoot,
boolean alwaysAllowAdminStatus)
Copyright © 2020. All rights reserved.