Class OrderDaoImpl
java.lang.Object
org.broadleafcommerce.core.order.dao.OrderDaoImpl
- All Implemented Interfaces:
OrderDao
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected org.broadleafcommerce.common.persistence.EntityConfigurationprotected OrderDaoExtensionManagerprotected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacquireLock(Order order) This method will attempt to update theOrderLockobject table for the given order to mark it as locked, provided the OrderLock record for the given order was not already locked.create()createNewCartForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer) voidprotected Booleanprotected Longprotected StringreadBatchOrders(int start, int pageSize, List<OrderStatus> statuses) Reads a batch list of orders from the DB.readBatchOrdersFromLastID(Long lastID, int pageSize, List<OrderStatus> statuses) Reads a batch list of orders from the DB starting at the ID passed in.readCartForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer) readNamedOrderForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, String name) readOrderByExternalId(String orderExternalId) readOrderById(Long orderId) readOrderById(Long orderId, boolean refresh) readOrderByIdIgnoreCache(Long orderId) readOrderByOrderNumber(String orderNumber) readOrdersByDateRange(Date startDate, Date endDate) readOrdersByEmail(String email) readOrdersByIds(List<Long> orderIds) readOrdersForCustomer(Long customerId) readOrdersForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, OrderStatus orderStatus) readOrdersForCustomersInDateRange(List<Long> customerIds, Date startDate, Date endDate) readOrdersOlderThanDaysCount(Integer daysCount, Integer batchSize) voidbooleanreleaseLock(Order order) Releases the lock for the given order.submitOrder(Order cartOrder) updatePrices(Order order)
-
Field Details
-
em
protected jakarta.persistence.EntityManager em -
entityConfiguration
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration -
extensionManager
-
transUtil
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
-
-
Constructor Details
-
OrderDaoImpl
public OrderDaoImpl()
-
-
Method Details
-
readOrderById
- Specified by:
readOrderByIdin interfaceOrderDao
-
readOrderByIdIgnoreCache
- Specified by:
readOrderByIdIgnoreCachein interfaceOrderDao
-
readOrderByExternalId
- Specified by:
readOrderByExternalIdin interfaceOrderDao
-
readOrderById
- Specified by:
readOrderByIdin interfaceOrderDao
-
readOrdersByIds
- Specified by:
readOrdersByIdsin interfaceOrderDao
-
readBatchOrders
Description copied from interface:OrderDaoReads a batch list of orders from the DB. The status is optional and can be null. If no status is provided, then all order will be read. Otherwise, only orders with that status will be read.- Specified by:
readBatchOrdersin interfaceOrderDao- Returns:
-
readBatchOrdersFromLastID
Description copied from interface:OrderDaoReads a batch list of orders from the DB starting at the ID passed in. The lookup sorts by ID so the proper starting point will be used. The status is optional and can be null. If no status is provided, then all order will be read. Otherwise, only orders with that status will be read.- Specified by:
readBatchOrdersFromLastIDin interfaceOrderDao- Returns:
-
save
-
delete
-
readOrdersForCustomer
public List<Order> readOrdersForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, OrderStatus orderStatus) - Specified by:
readOrdersForCustomerin interfaceOrderDao
-
readOrdersForCustomer
- Specified by:
readOrdersForCustomerin interfaceOrderDao
-
readCartForCustomer
- Specified by:
readCartForCustomerin interfaceOrderDao
-
createNewCartForCustomer
- Specified by:
createNewCartForCustomerin interfaceOrderDao
-
submitOrder
- Specified by:
submitOrderin interfaceOrderDao
-
create
-
refresh
-
readNamedOrderForCustomer
public Order readNamedOrderForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, String name) - Specified by:
readNamedOrderForCustomerin interfaceOrderDao
-
readOrderByOrderNumber
- Specified by:
readOrderByOrderNumberin interfaceOrderDao
-
readOrdersByDateRange
- Specified by:
readOrdersByDateRangein interfaceOrderDao
-
readOrdersOlderThanDaysCount
- Specified by:
readOrdersOlderThanDaysCountin interfaceOrderDao
-
readOrdersForCustomersInDateRange
public List<Order> readOrdersForCustomersInDateRange(List<Long> customerIds, Date startDate, Date endDate) - Specified by:
readOrdersForCustomersInDateRangein interfaceOrderDao
-
updatePrices
- Specified by:
updatePricesin interfaceOrderDao
-
acquireLock
Description copied from interface:OrderDaoThis method will attempt to update theOrderLockobject table for the given order to mark it as locked, provided the OrderLock record for the given order was not already locked. It will return true or false depending on whether or not the lock was able to be acquired.- Specified by:
acquireLockin interfaceOrderDao- Returns:
- true if the lock was acquired, false otherwise
-
releaseLock
Description copied from interface:OrderDaoReleases the lock for the given order. Note that this method will release the lock for the order whether or not the caller was the current owner of the lock. As such, callers of this method should take care to ensure they hold the lock before attempting to release it.- Specified by:
releaseLockin interfaceOrderDao- Returns:
- true if the lock was successfully released, false otherwise
-
getOrderLockKey
-
getDatabaseOrderLockSessionAffinity
-
getDatabaseOrderLockTimeToLive
-
readOrdersByEmail
- Specified by:
readOrdersByEmailin interfaceOrderDao
-
readNumberOfOrders
- Specified by:
readNumberOfOrdersin interfaceOrderDao
-