Class OrderDaoImpl

java.lang.Object
org.broadleafcommerce.core.order.dao.OrderDaoImpl
All Implemented Interfaces:
OrderDao

@Repository("blOrderDao") public class OrderDaoImpl extends Object implements OrderDao
  • Field Details

    • em

      protected jakarta.persistence.EntityManager em
    • entityConfiguration

      protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
    • extensionManager

      protected OrderDaoExtensionManager extensionManager
    • transUtil

      protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
  • Constructor Details

    • OrderDaoImpl

      public OrderDaoImpl()
  • Method Details

    • readOrderById

      public Order readOrderById(Long orderId)
      Specified by:
      readOrderById in interface OrderDao
    • readOrderByIdIgnoreCache

      public Order readOrderByIdIgnoreCache(Long orderId)
      Specified by:
      readOrderByIdIgnoreCache in interface OrderDao
    • readOrderByExternalId

      public Order readOrderByExternalId(String orderExternalId)
      Specified by:
      readOrderByExternalId in interface OrderDao
    • readOrderById

      @Transactional("blTransactionManager") public Order readOrderById(Long orderId, boolean refresh)
      Specified by:
      readOrderById in interface OrderDao
    • readOrdersByIds

      public List<Order> readOrdersByIds(List<Long> orderIds)
      Specified by:
      readOrdersByIds in interface OrderDao
    • readBatchOrders

      public List<Order> readBatchOrders(int start, int pageSize, List<OrderStatus> statuses)
      Description copied from interface: OrderDao
      Reads 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:
      readBatchOrders in interface OrderDao
      Returns:
    • readBatchOrdersFromLastID

      public List<Order> readBatchOrdersFromLastID(Long lastID, int pageSize, List<OrderStatus> statuses)
      Description copied from interface: OrderDao
      Reads 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:
      readBatchOrdersFromLastID in interface OrderDao
      Returns:
    • save

      public Order save(Order order)
      Specified by:
      save in interface OrderDao
    • delete

      public void delete(Order salesOrder)
      Specified by:
      delete in interface OrderDao
    • readOrdersForCustomer

      public List<Order> readOrdersForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, OrderStatus orderStatus)
      Specified by:
      readOrdersForCustomer in interface OrderDao
    • readOrdersForCustomer

      public List<Order> readOrdersForCustomer(Long customerId)
      Specified by:
      readOrdersForCustomer in interface OrderDao
    • readCartForCustomer

      public Order readCartForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer)
      Specified by:
      readCartForCustomer in interface OrderDao
    • createNewCartForCustomer

      public Order createNewCartForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer)
      Specified by:
      createNewCartForCustomer in interface OrderDao
    • submitOrder

      public Order submitOrder(Order cartOrder)
      Specified by:
      submitOrder in interface OrderDao
    • create

      public Order create()
      Specified by:
      create in interface OrderDao
    • refresh

      public void refresh(Order order)
      Specified by:
      refresh in interface OrderDao
    • readNamedOrderForCustomer

      public Order readNamedOrderForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, String name)
      Specified by:
      readNamedOrderForCustomer in interface OrderDao
    • readOrderByOrderNumber

      public Order readOrderByOrderNumber(String orderNumber)
      Specified by:
      readOrderByOrderNumber in interface OrderDao
    • readOrdersByDateRange

      public List<Order> readOrdersByDateRange(Date startDate, Date endDate)
      Specified by:
      readOrdersByDateRange in interface OrderDao
    • readOrdersOlderThanDaysCount

      public List<Order> readOrdersOlderThanDaysCount(Integer daysCount, Integer batchSize)
      Specified by:
      readOrdersOlderThanDaysCount in interface OrderDao
    • readOrdersForCustomersInDateRange

      public List<Order> readOrdersForCustomersInDateRange(List<Long> customerIds, Date startDate, Date endDate)
      Specified by:
      readOrdersForCustomersInDateRange in interface OrderDao
    • updatePrices

      @Transactional("blTransactionManager") public Order updatePrices(Order order)
      Specified by:
      updatePrices in interface OrderDao
    • acquireLock

      public boolean acquireLock(Order order)
      Description copied from interface: OrderDao
      This method will attempt to update the OrderLock object 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:
      acquireLock in interface OrderDao
      Returns:
      true if the lock was acquired, false otherwise
    • releaseLock

      public boolean releaseLock(Order order)
      Description copied from interface: OrderDao
      Releases 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:
      releaseLock in interface OrderDao
      Returns:
      true if the lock was successfully released, false otherwise
    • getOrderLockKey

      protected String getOrderLockKey()
    • getDatabaseOrderLockSessionAffinity

      protected Boolean getDatabaseOrderLockSessionAffinity()
    • getDatabaseOrderLockTimeToLive

      protected Long getDatabaseOrderLockTimeToLive()
    • readOrdersByEmail

      public List<Order> readOrdersByEmail(String email)
      Specified by:
      readOrdersByEmail in interface OrderDao
    • readNumberOfOrders

      public Long readNumberOfOrders()
      Specified by:
      readNumberOfOrders in interface OrderDao