com.softslate.commerce.daos.order
Class OrderGatewayDAOHibernate

java.lang.Object
  extended by com.softslate.commerce.daos.core.BaseDAO
      extended by com.softslate.commerce.daos.core.BaseAdminGatewayDAOHibernate
          extended by com.softslate.commerce.daos.order.OrderGatewayDAOHibernate
All Implemented Interfaces:
DAOInterface, OrderGatewayDAO

public class OrderGatewayDAOHibernate
extends BaseAdminGatewayDAOHibernate
implements OrderGatewayDAO

Generic DAO that runs miscellaneous queries related to orders.

Author:
David Tobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Constructor Summary
OrderGatewayDAOHibernate()
           
 
Method Summary
 void deactivateProducts(boolean commit, java.util.Collection productsToDeactivate)
           
 void decrementSKUs(boolean commit, java.util.Collection skusToDecrement)
           
 int deleteIncompleteOrders(boolean commit, java.util.Map parameters)
           
 int deleteOrderDiscounts(boolean commit, int orderID)
           
 void editDeleteOrders(java.util.Map parameters, BusinessObjectFactory bof)
           
 java.util.Collection getDiscountsBySkuIDs(java.util.Collection skuIDs)
           
 java.util.Collection getGlobalDiscounts()
           
 java.lang.Double getPreviousOrderTotal(int customerID)
           
 java.util.Collection getProductInfoFromCodes(java.lang.String[] productCodeArray)
           
 java.lang.Integer getTimesUsedByCustomer(int discountID, int customerID)
           
 void incrementOrderSKUs(Order o)
          Increments all the SKUs associated with the order items in a given order by the quantity of the item.
 void incrementSKUs(boolean commit, OrderItem orderItem)
           
 void insertOrderAndDelivery(Order order, OrderDelivery orderDelivery)
           
 java.util.Collection loadDashboardStatistics()
           
 java.util.Collection loadExport(java.util.Date startDate, java.util.Date endDate, boolean allOrders)
           
 java.util.Collection loadIncompleteOrdersStatistics()
           
 java.util.Map loadOrdersAndCount(java.util.Map parameters)
           
 StatesAndCountries loadStatesAndCountries(StatesAndCountries statesAndCountries)
           
 org.hibernate.Criteria processCommonCriteria(org.hibernate.Criteria crit, java.util.Map parameters)
           
 void processOrderComplete(Order order, java.util.Map parameters)
           
 void processOrderItems(User user, java.util.Collection newOrderItems, java.util.Map parameters)
           
 void removeOrderItem(Order order, OrderDelivery orderDelivery, OrderItem orderItem)
           
 void updateOrderAndDelivery(boolean commit, Order order, OrderDelivery orderDelivery)
           
 
Methods inherited from class com.softslate.commerce.daos.core.BaseAdminGatewayDAOHibernate
editDeleteItems, loadItems, loadItemsAndCount, loadItemsCount, loadItemsFromIDs
 
Methods inherited from class com.softslate.commerce.daos.core.BaseDAO
deleteObject, evictCache, formatDateTime, getAppComponents, getAppSettings, getConnection, getDaoFactory, getDAOUtils, getDataSource, getImportExportSQL, getImportExportSqlMap, getNamedQuery, getSettings, getSQL, getSqlMap, initialize, insertObject, loadAll, loadAll, loadObject, parseDateTime, setAppComponents, setAppSettings, setConnection, setDaoFactory, setDAOUtils, setDataSource, setImportExportSqlMap, setSettings, setSqlMap, updateObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softslate.commerce.daos.core.DAOInterface
deleteObject, getAppComponents, getAppSettings, getConnection, getDaoFactory, getDAOUtils, getDataSource, getSettings, getSqlMap, initialize, insertObject, loadAll, loadAll, loadObject, setAppComponents, setAppSettings, setConnection, setDaoFactory, setDAOUtils, setDataSource, setSettings, setSqlMap, updateObject
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

OrderGatewayDAOHibernate

public OrderGatewayDAOHibernate()
Method Detail

loadStatesAndCountries

public StatesAndCountries loadStatesAndCountries(StatesAndCountries statesAndCountries)
                                          throws DataAccessException
Specified by:
loadStatesAndCountries in interface OrderGatewayDAO
Throws:
DataAccessException

loadDashboardStatistics

public java.util.Collection loadDashboardStatistics()
                                             throws DataAccessException
Specified by:
loadDashboardStatistics in interface OrderGatewayDAO
Throws:
DataAccessException

loadIncompleteOrdersStatistics

public java.util.Collection loadIncompleteOrdersStatistics()
                                                    throws DataAccessException
Specified by:
loadIncompleteOrdersStatistics in interface OrderGatewayDAO
Throws:
DataAccessException

deleteIncompleteOrders

public int deleteIncompleteOrders(boolean commit,
                                  java.util.Map parameters)
                           throws DataAccessException
Specified by:
deleteIncompleteOrders in interface OrderGatewayDAO
Throws:
DataAccessException

insertOrderAndDelivery

public void insertOrderAndDelivery(Order order,
                                   OrderDelivery orderDelivery)
                            throws java.lang.Exception
Specified by:
insertOrderAndDelivery in interface OrderGatewayDAO
Throws:
java.lang.Exception

getProductInfoFromCodes

public java.util.Collection getProductInfoFromCodes(java.lang.String[] productCodeArray)
                                             throws java.lang.Exception
Specified by:
getProductInfoFromCodes in interface OrderGatewayDAO
Throws:
java.lang.Exception

processOrderItems

public void processOrderItems(User user,
                              java.util.Collection newOrderItems,
                              java.util.Map parameters)
                       throws java.lang.Exception
Specified by:
processOrderItems in interface OrderGatewayDAO
Throws:
java.lang.Exception

decrementSKUs

public void decrementSKUs(boolean commit,
                          java.util.Collection skusToDecrement)
                   throws java.lang.Exception
Throws:
java.lang.Exception

incrementSKUs

public void incrementSKUs(boolean commit,
                          OrderItem orderItem)
                   throws java.lang.Exception
Throws:
java.lang.Exception

incrementOrderSKUs

public void incrementOrderSKUs(Order o)
                        throws java.lang.Exception
Increments all the SKUs associated with the order items in a given order by the quantity of the item. Used to refresh the SKU inventory levels when incomplete orders are deleted, if the inventory decrement behavior is set to decrement upon adding items to the cart.

Parameters:
o - The Order being processed.
Throws:
java.lang.Exception

deactivateProducts

public void deactivateProducts(boolean commit,
                               java.util.Collection productsToDeactivate)
                        throws java.lang.Exception
Throws:
java.lang.Exception

removeOrderItem

public void removeOrderItem(Order order,
                            OrderDelivery orderDelivery,
                            OrderItem orderItem)
                     throws java.lang.Exception
Specified by:
removeOrderItem in interface OrderGatewayDAO
Throws:
java.lang.Exception

updateOrderAndDelivery

public void updateOrderAndDelivery(boolean commit,
                                   Order order,
                                   OrderDelivery orderDelivery)
                            throws java.lang.Exception
Specified by:
updateOrderAndDelivery in interface OrderGatewayDAO
Throws:
java.lang.Exception

loadOrdersAndCount

public java.util.Map loadOrdersAndCount(java.util.Map parameters)
                                 throws java.lang.Exception
Specified by:
loadOrdersAndCount in interface OrderGatewayDAO
Throws:
java.lang.Exception

editDeleteOrders

public void editDeleteOrders(java.util.Map parameters,
                             BusinessObjectFactory bof)
                      throws java.lang.Exception
Specified by:
editDeleteOrders in interface OrderGatewayDAO
Throws:
java.lang.Exception

processCommonCriteria

public org.hibernate.Criteria processCommonCriteria(org.hibernate.Criteria crit,
                                                    java.util.Map parameters)
Overrides:
processCommonCriteria in class BaseAdminGatewayDAOHibernate

processOrderComplete

public void processOrderComplete(Order order,
                                 java.util.Map parameters)
                          throws java.lang.Exception
Specified by:
processOrderComplete in interface OrderGatewayDAO
Throws:
java.lang.Exception

deleteOrderDiscounts

public int deleteOrderDiscounts(boolean commit,
                                int orderID)
                         throws DataAccessException
Specified by:
deleteOrderDiscounts in interface OrderGatewayDAO
Throws:
DataAccessException

getDiscountsBySkuIDs

public java.util.Collection getDiscountsBySkuIDs(java.util.Collection skuIDs)
                                          throws java.lang.Exception
Specified by:
getDiscountsBySkuIDs in interface OrderGatewayDAO
Throws:
java.lang.Exception

getPreviousOrderTotal

public java.lang.Double getPreviousOrderTotal(int customerID)
                                       throws java.lang.Exception
Specified by:
getPreviousOrderTotal in interface OrderGatewayDAO
Throws:
java.lang.Exception

getTimesUsedByCustomer

public java.lang.Integer getTimesUsedByCustomer(int discountID,
                                                int customerID)
                                         throws java.lang.Exception
Specified by:
getTimesUsedByCustomer in interface OrderGatewayDAO
Throws:
java.lang.Exception

getGlobalDiscounts

public java.util.Collection getGlobalDiscounts()
                                        throws java.lang.Exception
Specified by:
getGlobalDiscounts in interface OrderGatewayDAO
Throws:
java.lang.Exception

loadExport

public java.util.Collection loadExport(java.util.Date startDate,
                                       java.util.Date endDate,
                                       boolean allOrders)
                                throws java.lang.Exception
Specified by:
loadExport in interface OrderGatewayDAO
Throws:
java.lang.Exception


Copyright ? SoftSlate, LLC 2003?2005