Class OrderGatewayDAOHibernate
java.lang.Object
com.softslate.commerce.daos.core.BaseDAO
com.softslate.commerce.daos.core.BaseAdminGatewayDAOHibernate
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deactivateProducts
(boolean commit, Collection productsToDeactivate) void
decrementSKUs
(boolean commit, Collection skusToDecrement) int
deleteIncompleteOrders
(boolean commit, Map parameters) protected int
deleteIncompleteOrdersWhileIncrementingInventory
(boolean commit, Map parameters) int
deleteOrderDiscounts
(boolean commit, int orderID) editDeleteOrders
(Map parameters, BusinessObjectFactory bof) getDiscountsBySkuIDs
(Collection skuIDs) getGlobalDiscounts
(Collection couponCodes) getPreviousOrderTotal
(int customerID) getProductInfoFromCodes
(String[] productCodeArray) getTimesUsedByCustomer
(int discountID, int customerID) void
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) void
insertOrderNumber
(OrderNumber orderNumber, boolean commit) loadAbandonedCartOrders
(String startDate, String endDate, String prevOrdersDate) loadCompletedOrdersByDateRange
(String startDate, String endDate, Collection<String> ignoreStatuses) loadCompletedOrdersByLastModifiedAndStatuses
(String startDate, String endDate, Collection<String> currentStatuses) loadExport
(String startDate, String endDate, boolean allOrders, int firstID, int lastID) loadGiftCertificates
(Collection couponCodes) loadIncompleteOrdersWithPayments
(Map parameters) int
loadMonthlySalesReport
(String startDate, String endDate) loadOrdersAndCount
(Map parameters) loadSalesByProductReport
(String startDate, String endDate, Integer[] productIDs) loadShippingDiscounts
(Collection couponCodes) loadStatesAndCountries
(StatesAndCountries statesAndCountries) void
markOrderComplete
(Order order, Map parameters) postChangedItemEvent
(Object item, Map parameters, BusinessObjectFactory bof) postChangingItemEvent
(Object item, Map parameters, BusinessObjectFactory bof) org.hibernate.Criteria
processCommonCriteria
(org.hibernate.Criteria crit, Map parameters) void
processOrderComplete
(Order order, Map parameters) void
processOrderItems
(User user, Collection newOrderItems, 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
editDeleteAssignments, editDeleteItems, incomingPropertiesByIndex, loadItems, loadItemsAndCount, loadItemsCount, loadItemsFromIDs, setPropertiesDynamically
Methods inherited from class com.softslate.commerce.daos.core.BaseDAO
deleteObject, doWorkToSetConnection, editAssignment, evictCache, formatDateTime, getAppComponents, getAppSettings, getConnection, getDaoFactory, getDAOUtils, getDataSource, getImportExportSQL, getImportExportSqlMap, getInjector, getNamedQuery, getSettings, getSQL, getSqlMap, initialize, insertObject, loadAll, loadAll, loadObject, parseDateTime, setAppComponents, setAppSettings, setConnection, setDaoFactory, setDAOUtils, setDataSource, setImportExportSqlMap, setInjector, 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, formatDateTime, getAppComponents, getAppSettings, getConnection, getDaoFactory, getDAOUtils, getDataSource, getInjector, getSettings, getSqlMap, initialize, insertObject, loadAll, loadAll, loadObject, parseDateTime, setAppComponents, setAppSettings, setConnection, setDaoFactory, setDAOUtils, setDataSource, setInjector, setSettings, setSqlMap, updateObject
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
OrderGatewayDAOHibernate
public OrderGatewayDAOHibernate()
-
-
Method Details
-
loadStatesAndCountries
public StatesAndCountries loadStatesAndCountries(StatesAndCountries statesAndCountries) throws DataAccessException - Specified by:
loadStatesAndCountries
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadDashboardStatistics
- Specified by:
loadDashboardStatistics
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadIncompleteOrdersStatistics
- Specified by:
loadIncompleteOrdersStatistics
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
deleteIncompleteOrders
- Specified by:
deleteIncompleteOrders
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
deleteIncompleteOrdersWhileIncrementingInventory
protected int deleteIncompleteOrdersWhileIncrementingInventory(boolean commit, Map parameters) throws DataAccessException - Throws:
DataAccessException
-
insertOrderAndDelivery
- Specified by:
insertOrderAndDelivery
in interfaceOrderGatewayDAO
- Throws:
Exception
-
getProductInfoFromCodes
- Specified by:
getProductInfoFromCodes
in interfaceOrderGatewayDAO
- Throws:
Exception
-
processOrderItems
- Specified by:
processOrderItems
in interfaceOrderGatewayDAO
- Throws:
Exception
-
decrementSKUs
- Throws:
Exception
-
incrementSKUs
- Throws:
Exception
-
incrementOrderSKUs
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
- TheOrder
being processed.- Throws:
Exception
-
deactivateProducts
- Throws:
Exception
-
removeOrderItem
public void removeOrderItem(Order order, OrderDelivery orderDelivery, OrderItem orderItem) throws Exception - Specified by:
removeOrderItem
in interfaceOrderGatewayDAO
- Throws:
Exception
-
updateOrderAndDelivery
public void updateOrderAndDelivery(boolean commit, Order order, OrderDelivery orderDelivery) throws Exception - Specified by:
updateOrderAndDelivery
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadOrdersAndCount
- Specified by:
loadOrdersAndCount
in interfaceOrderGatewayDAO
- Throws:
Exception
-
editDeleteOrders
- Specified by:
editDeleteOrders
in interfaceOrderGatewayDAO
- Throws:
Exception
-
processCommonCriteria
- Overrides:
processCommonCriteria
in classBaseAdminGatewayDAOHibernate
-
postChangingItemEvent
public Map postChangingItemEvent(Object item, Map parameters, BusinessObjectFactory bof) throws Exception - Overrides:
postChangingItemEvent
in classBaseAdminGatewayDAOHibernate
- Throws:
Exception
-
postChangedItemEvent
public Map postChangedItemEvent(Object item, Map parameters, BusinessObjectFactory bof) throws Exception - Overrides:
postChangedItemEvent
in classBaseAdminGatewayDAOHibernate
- Throws:
Exception
-
processOrderComplete
- Specified by:
processOrderComplete
in interfaceOrderGatewayDAO
- Throws:
Exception
-
insertOrderNumber
- Specified by:
insertOrderNumber
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
markOrderComplete
- Specified by:
markOrderComplete
in interfaceOrderGatewayDAO
- Throws:
Exception
-
deleteOrderDiscounts
- Specified by:
deleteOrderDiscounts
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
getDiscountsBySkuIDs
- Specified by:
getDiscountsBySkuIDs
in interfaceOrderGatewayDAO
- Throws:
Exception
-
getPreviousOrderTotal
- Specified by:
getPreviousOrderTotal
in interfaceOrderGatewayDAO
- Throws:
Exception
-
getTimesUsedByCustomer
- Specified by:
getTimesUsedByCustomer
in interfaceOrderGatewayDAO
- Throws:
Exception
-
getGlobalDiscounts
- Specified by:
getGlobalDiscounts
in interfaceOrderGatewayDAO
- Throws:
Exception
-
getGlobalDiscounts
- Specified by:
getGlobalDiscounts
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadShippingDiscounts
- Throws:
Exception
-
loadShippingDiscounts
- Specified by:
loadShippingDiscounts
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadGiftCertificates
- Specified by:
loadGiftCertificates
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadExport
public Collection loadExport(String startDate, String endDate, boolean allOrders, int firstID, int lastID) throws Exception - Specified by:
loadExport
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadSalesByProductReport
public Collection loadSalesByProductReport(String startDate, String endDate, Integer[] productIDs) throws DataAccessException - Specified by:
loadSalesByProductReport
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadMonthlySalesReport
public Collection loadMonthlySalesReport(String startDate, String endDate) throws DataAccessException - Specified by:
loadMonthlySalesReport
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadMaxOrderID
- Specified by:
loadMaxOrderID
in interfaceOrderGatewayDAO
- Throws:
Exception
-
loadIncompleteOrdersWithPayments
- Specified by:
loadIncompleteOrdersWithPayments
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadCompletedOrdersByDateRange
public Collection<Order> loadCompletedOrdersByDateRange(String startDate, String endDate, Collection<String> ignoreStatuses) throws DataAccessException - Specified by:
loadCompletedOrdersByDateRange
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadAbandonedCartOrders
public Collection<Order> loadAbandonedCartOrders(String startDate, String endDate, String prevOrdersDate) throws DataAccessException - Specified by:
loadAbandonedCartOrders
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-
loadCompletedOrdersByLastModifiedAndStatuses
public Collection<Order> loadCompletedOrdersByLastModifiedAndStatuses(String startDate, String endDate, Collection<String> currentStatuses) throws DataAccessException - Specified by:
loadCompletedOrdersByLastModifiedAndStatuses
in interfaceOrderGatewayDAO
- Throws:
DataAccessException
-