org.broadleafcommerce.core.order.dao
Class OrderDaoImpl

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

@Repository(value="blOrderDao")
public class OrderDaoImpl
extends Object
implements OrderDao


Field Summary
protected  CustomerDao customerDao
           
protected  javax.persistence.EntityManager em
           
protected  EntityConfiguration entityConfiguration
           
protected  OrderDaoExtensionManager extensionManager
           
 
Constructor Summary
OrderDaoImpl()
           
 
Method Summary
 Order create()
           
 Order createNewCartForCustomer(Customer customer)
           
 void delete(Order salesOrder)
           
 List<Order> findCarts(String[] names, OrderStatus[] statuses, Date dateCreatedMinThreshold)
          Deletes carts from the database.
 Order readCartForCustomer(Customer customer)
           
 Order readNamedOrderForCustomer(Customer customer, String name)
           
 Order readOrderById(Long orderId)
           
 Order readOrderByOrderNumber(String orderNumber)
           
 List<Order> readOrdersForCustomer(Customer customer, OrderStatus orderStatus)
           
 List<Order> readOrdersForCustomer(Long customerId)
           
 Order save(Order order)
           
 Order submitOrder(Order cartOrder)
           
 Order updatePrices(Order order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em

entityConfiguration

protected EntityConfiguration entityConfiguration

customerDao

protected CustomerDao customerDao

extensionManager

protected OrderDaoExtensionManager extensionManager
Constructor Detail

OrderDaoImpl

public OrderDaoImpl()
Method Detail

readOrderById

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

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(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(Customer customer)
Specified by:
readCartForCustomer in interface OrderDao

createNewCartForCustomer

public Order createNewCartForCustomer(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

readNamedOrderForCustomer

public Order readNamedOrderForCustomer(Customer customer,
                                       String name)
Specified by:
readNamedOrderForCustomer in interface OrderDao

readOrderByOrderNumber

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

updatePrices

public Order updatePrices(Order order)
Specified by:
updatePrices in interface OrderDao

findCarts

public List<Order> findCarts(String[] names,
                             OrderStatus[] statuses,
                             Date dateCreatedMinThreshold)
Description copied from interface: OrderDao
Deletes 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 deletion 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 OrderDao
Parameters:
names - One or more order names to restrict the deletion by. Can be null.
statuses - One or more order statuses to restrict the deletion by. Can be null.
dateCreatedMinThreshold - Min creation date to restrict the deletion by. Orders created before this date are removed. Can be null.
Returns:
the number of deleted carts


Copyright © 2013. All Rights Reserved.