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 Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManager
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> void
applyLimitedInClause
(List<Long> ids, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<T> root, List<jakarta.persistence.criteria.Predicate> restrictions) protected <T> jakarta.persistence.TypedQuery<T>
buildCartQuery
(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, Class<T> returnType, List<Long> excludedIds) protected <T> jakarta.persistence.TypedQuery<T>
buildCustomerQuery
(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, Class<T> returnType, List<Long> excludedIds) findCarts
(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, int startPos, int length, List<Long> excludedIds) Finds carts from the database.findCarts
(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, List<Long> excludedIds) Finds carts from the database.findCartsCount
(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold, Boolean isPreview, List<Long> excludedIds) Finds the count of carts from the database.findCustomers
(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, int startPos, int length, List<Long> excludedIds) Find customers in the database.findCustomers
(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, List<Long> excludedIds) Find customers in the database.findCustomersCount
(Date dateCreatedMinThreshold, Boolean registered, Boolean deactivated, Boolean isPreview, List<Long> excludedIds) Find count of customers in the database.
-
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 interfaceResourcePurgeDao
- 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 interfaceResourcePurgeDao
- 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 interfaceResourcePurgeDao
- 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 interfaceResourcePurgeDao
- 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 interfaceResourcePurgeDao
- 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 interfaceResourcePurgeDao
- 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
-
applyLimitedInClause
-
buildCartQuery
-