com.softslate.commerce.daos.customer
Class CustomerDAOHibernate

java.lang.Object
  extended by com.softslate.commerce.daos.core.BaseDAO
      extended by com.softslate.commerce.daos.customer.CustomerDAOHibernate
All Implemented Interfaces:
DAOInterface, CustomerDAO

public class CustomerDAOHibernate
extends BaseDAO
implements CustomerDAO

Generic DAO to manage the sscCustomer table of the database.

Author:
David Tobey

Field Summary
private  Customer customer
           
(package private) static org.apache.commons.logging.Log log
           
 
Constructor Summary
CustomerDAOHibernate()
           
 
Method Summary
 void deleteCustomer()
           
 void deleteCustomer(boolean commit)
           
 Customer getCustomer()
           
 int getUserNameCount()
           
 int getUserNameCount(boolean commit)
           
 void insertCustomer()
           
 void insertCustomer(boolean commit)
           
 java.util.Collection loadAddressCollection()
          Populate a collection of CustomerAddress objects, one for each of the addresses associated with this customer.
 void loadCustomerFromID()
           
 java.util.Collection loadDownloadFiles()
          Populate a collection of Maps for each file available for the customer to download.
 void loadFromUserName()
          Assuming the userName property has been set, queries the database for a customer record that matches.
 void loadFromUserNameAndPassword()
          Assuming the userName and password properties have been set, queries the database for a customer record that matches.
 java.util.Collection loadOrderHistory()
          Populate a collection of Order objects, one for each order in this customer's order history.
 java.lang.String loadPasswordByID()
           
 java.util.Collection loadSavedCarts()
          Return a collection of Order objects, one for each cart this customer has saved.
 void setCustomer(Customer customer)
           
 void updateCustomer()
           
 void updateCustomer(boolean commit)
           
 void updateCustomer(boolean commit, boolean forcePassword)
           
 
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

customer

private Customer customer
Constructor Detail

CustomerDAOHibernate

public CustomerDAOHibernate()
Method Detail

getCustomer

public Customer getCustomer()
Specified by:
getCustomer in interface CustomerDAO

setCustomer

public void setCustomer(Customer customer)
Specified by:
setCustomer in interface CustomerDAO

loadCustomerFromID

public void loadCustomerFromID()
                        throws java.lang.Exception
Specified by:
loadCustomerFromID in interface CustomerDAO
Throws:
java.lang.Exception

loadPasswordByID

public java.lang.String loadPasswordByID()
                                  throws DataAccessException
Throws:
DataAccessException

getUserNameCount

public int getUserNameCount()
                     throws java.lang.Exception
Specified by:
getUserNameCount in interface CustomerDAO
Throws:
java.lang.Exception

getUserNameCount

public int getUserNameCount(boolean commit)
                     throws java.lang.Exception
Specified by:
getUserNameCount in interface CustomerDAO
Throws:
java.lang.Exception

insertCustomer

public void insertCustomer()
                    throws DataAccessException
Specified by:
insertCustomer in interface CustomerDAO
Throws:
DataAccessException

insertCustomer

public void insertCustomer(boolean commit)
                    throws DataAccessException
Specified by:
insertCustomer in interface CustomerDAO
Throws:
DataAccessException

updateCustomer

public void updateCustomer()
                    throws DataAccessException
Specified by:
updateCustomer in interface CustomerDAO
Throws:
DataAccessException

updateCustomer

public void updateCustomer(boolean commit)
                    throws DataAccessException
Specified by:
updateCustomer in interface CustomerDAO
Throws:
DataAccessException

updateCustomer

public void updateCustomer(boolean commit,
                           boolean forcePassword)
                    throws DataAccessException
Specified by:
updateCustomer in interface CustomerDAO
Throws:
DataAccessException

loadFromUserName

public void loadFromUserName()
                      throws java.lang.Exception
Assuming the userName property has been set, queries the database for a customer record that matches.

Specified by:
loadFromUserName in interface CustomerDAO
Throws:
java.lang.Exception

loadFromUserNameAndPassword

public void loadFromUserNameAndPassword()
                                 throws java.lang.Exception
Assuming the userName and password properties have been set, queries the database for a customer record that matches.

Specified by:
loadFromUserNameAndPassword in interface CustomerDAO
Throws:
java.lang.Exception

loadAddressCollection

public java.util.Collection loadAddressCollection()
                                           throws java.lang.Exception
Populate a collection of CustomerAddress objects, one for each of the addresses associated with this customer.

Specified by:
loadAddressCollection in interface CustomerDAO
Throws:
java.lang.Exception

loadOrderHistory

public java.util.Collection loadOrderHistory()
                                      throws java.lang.Exception
Populate a collection of Order objects, one for each order in this customer's order history.

Specified by:
loadOrderHistory in interface CustomerDAO
Throws:
java.lang.Exception

loadDownloadFiles

public java.util.Collection loadDownloadFiles()
                                       throws java.lang.Exception
Description copied from interface: CustomerDAO
Populate a collection of Maps for each file available for the customer to download.

Specified by:
loadDownloadFiles in interface CustomerDAO
Throws:
java.lang.Exception

loadSavedCarts

public java.util.Collection loadSavedCarts()
                                    throws java.lang.Exception
Return a collection of Order objects, one for each cart this customer has saved.

Specified by:
loadSavedCarts in interface CustomerDAO
Throws:
java.lang.Exception

deleteCustomer

public void deleteCustomer()
                    throws DataAccessException
Specified by:
deleteCustomer in interface CustomerDAO
Throws:
DataAccessException

deleteCustomer

public void deleteCustomer(boolean commit)
                    throws DataAccessException
Specified by:
deleteCustomer in interface CustomerDAO
Throws:
DataAccessException


Copyright ? SoftSlate, LLC 2003?2005