Class ResourcePurgeDaoImpl

java.lang.Object
org.broadleafcommerce.core.util.dao.ResourcePurgeDaoImpl
All Implemented Interfaces:
ResourcePurgeDao

@Repository("blResourcePurgeDao") public class ResourcePurgeDaoImpl extends Object implements ResourcePurgeDao
Author:
Jeff Fischer
  • Field Details

    • RESTRICT_IN_CLAUSE_MAX_SIZE

      public static final int RESTRICT_IN_CLAUSE_MAX_SIZE
      See Also:
    • em

      protected jakarta.persistence.EntityManager em
  • Constructor Details

    • ResourcePurgeDaoImpl

      public ResourcePurgeDaoImpl()
  • Method Details

    • findCarts

      public List<Order> findCarts(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Finds carts from the database. Carts are generally considered orders that have not made it to the submitted status. The method parameters can be left null, or included to refine the select criteria. Note, if statuses are null, the query defaults to selecting only orders that have a status of IN_PROCESS.
      Specified by:
      findCarts in interface ResourcePurgeDao
      Parameters:
      names - One or more order names to restrict the select by. Can be null.
      statuses - One or more order statuses to restrict the select by. Can be null.
      dateCreatedMinThreshold - Min creation date to restrict the select by. Orders created before this date are retrieved. Can be null.
      isPreview - whether or not the results should be preview orders. Can be null.
      Returns:
      the list of found carts
    • findCarts

      public List<Order> findCarts(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, int startPos, int length, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Finds carts from the database. Carts are generally considered orders that have not made it to the submitted status. The method parameters can be left null, or included to refine the select criteria. Note, if statuses are null, the query defaults to selecting only orders that have a status of IN_PROCESS. This overloaded version of the method is capable of retrieving a portion or "page" of the total results.
      Specified by:
      findCarts in interface ResourcePurgeDao
      Parameters:
      names - One or more order names to restrict the select by. Can be null.
      statuses - One or more order statuses to restrict the select by. Can be null.
      dateCreatedMinThreshold - Min creation date to restrict the select by. Orders created before this date are retrieved. Can be null.
      isPreview - whether or not the results should be preview orders. Can be null.
      startPos - the position in the overall result set from which to start the returned list.
      length - the max number of results to include in the returned list.
      Returns:
      the list of found carts
    • findCartsCount

      public Long findCartsCount(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Finds the count of carts from the database. Carts are generally considered orders that have not made it to the submitted status. The method parameters can be left null, or included to refine the select criteria. Note, if statuses are null, the query defaults to selecting only orders that have a status of IN_PROCESS.
      Specified by:
      findCartsCount in interface ResourcePurgeDao
      Parameters:
      names - One or more order names to restrict the select by. Can be null.
      statuses - One or more order statuses to restrict the select by. Can be null.
      dateCreatedMinThreshold - Min creation date to restrict the select by. Orders created before this date are retrieved. Can be null.
      isPreview - whether or not the results should be preview orders. Can be null.
      Returns:
      the number of carts found
    • findCustomers

      public List<Customer> findCustomers(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Find customers in the database. The method parameters can be left null, or included to refine the select criteria.
      Specified by:
      findCustomers in interface ResourcePurgeDao
      Parameters:
      dateCreatedMinThreshold - Min creation date to restrict the select by. Customers created before this date are retrieved. Can be null.
      registered - Whether or not the results should be registered customers. Can be null.
      deactivated - Whether or not the results should be deactivated customers. Can be null.
      isPreview - Whether or not the results should be preview customers. Can be null.
      Returns:
      the list of found customers
    • findCustomers

      public List<Customer> findCustomers(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, int startPos, int length, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Find customers in the database. The method parameters can be left null, or included to refine the select criteria. This overloaded version of the method is capable of retrieving a portion or "page" of the total results.
      Specified by:
      findCustomers in interface ResourcePurgeDao
      Parameters:
      dateCreatedMinThreshold - Min creation date to restrict the select by. Customers created before this date are retrieved. Can be null.
      registered - Whether or not the results should be registered customers. Can be null.
      deactivated - Whether or not the results should be deactivated customers. Can be null.
      isPreview - Whether or not the results should be preview customers. Can be null.
      startPos - the position in the overall result set from which to start the returned list.
      length - the max number of results to include in the returned list.
      Returns:
      the list of found customers
    • findCustomersCount

      public Long findCustomersCount(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, List<Long> excludedIds)
      Description copied from interface: ResourcePurgeDao
      Find count of customers in the database. The method parameters can be left null, or included to refine the select criteria.
      Specified by:
      findCustomersCount in interface ResourcePurgeDao
      Parameters:
      dateCreatedMinThreshold - Min creation date to restrict the select by. Customers created before this date are retrieved. Can be null.
      registered - Whether or not the results should be registered customers. Can be null.
      deactivated - Whether or not the results should be deactivated customers. Can be null.
      isPreview - Whether or not the results should be preview customers. Can be null.
      Returns:
      the count of found customers
    • buildCustomerQuery

      protected <T> jakarta.persistence.TypedQuery<T> buildCustomerQuery(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, Class<T> returnType, List<Long> excludedIds)
    • applyLimitedInClause

      protected <T> void applyLimitedInClause(List<Long> ids, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<T> root, List<jakarta.persistence.criteria.Predicate> restrictions)
    • buildCartQuery

      protected <T> jakarta.persistence.TypedQuery<T> buildCartQuery(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, Class<T> returnType, List<Long> excludedIds)