org.openxma.dsl.reference.dao.impl
Class CustomerDaoImpl

java.lang.Object
  extended by org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Customer,java.lang.String>
      extended by org.openxma.dsl.reference.dao.impl.CustomerDaoImpl
All Implemented Interfaces:
org.openxma.dsl.platform.dao.EntityFactory<Customer>, org.openxma.dsl.platform.dao.FinderExecutor<Customer>, org.openxma.dsl.platform.dao.GenericDao<Customer,java.lang.String>, CustomerDao

@Repository(value="customerDao")
public class CustomerDaoImpl
extends org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Customer,java.lang.String>
implements CustomerDao

See Also:
CustomerDao

Field Summary
 
Fields inherited from class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl
argumentTypeFactory, dataFieldMaxValueIncrementer, logger, namingStrategy, sessionFactory, type
 
Fields inherited from interface org.openxma.dsl.reference.dao.CustomerDao
LAST_NAME_ASC
 
Constructor Summary
CustomerDaoImpl()
           
 
Method Summary
 Customer create()
          Factory method to create an empty CustomerDao entity with an already assigned identifier.
 Customer create(Address invoiceAddress, Address deliveryAddress, java.lang.String customerFirstName, java.lang.String customerLastName, java.lang.String emailAddress, java.util.Date customerBirthDate)
          Factory method to create an empty CustomerDao taking all not null attributes.
 Customer createAndSave(Address invoiceAddress, Address deliveryAddress, java.lang.String customerFirstName, java.lang.String customerLastName, java.lang.String emailAddress, java.util.Date customerBirthDate)
          Factory method to create and save an empty CustomerDao taking all not null attributes.
 Customer createEntity(java.lang.Object context)
           
 java.util.List<Customer> findAllByEmailAdressOrBirthDate(java.lang.String emailAddress, java.util.Date birthDate)
          Execute a query based on the given attributes.
 java.util.List<Customer> findAllByFirstNameAndLastName(java.lang.String firstName, java.lang.String lastName)
          Execute a query based on the given attributes.
 java.util.List<Customer> findAllByLastNameJoinOrdersDate(java.lang.String lastName, java.util.Date ordersPlacementDate)
          Execute a query based on the given attributes.
 Customer findByFirstOrLastNameJoinOrder(java.lang.String firstName, java.lang.String lastName, StateAndDateQuery stateAndDateQuery)
          Execute a query based on the given attributes.
 java.util.List<Customer> findByNamedQueryCustomerLastName(java.lang.String lastName)
           
 Customer loadByCustomerNk(java.lang.String customerFirstName, java.lang.String customerLastName, java.util.Date customerBirthDate)
          Return the persistent instance of the Customer entity class with the given natural identifier or null if not found.
 Customer loadByCustomerUkEmail(java.lang.String emailAddress)
          Return the persistent instance of the Customer entity class with the given unique-key or null if not found.
 void setDataFieldMaxValueIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer dataFieldMaxValueIncrementer)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 
Methods inherited from class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl
applyPagingParameters, delete, delete, evict, executeFinder, find, findAll, findByExample, get, iterateFinder, load, merge, read, refresh, saveOrUpdate, setArgumentTypeFactory, setNamingStrategy, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openxma.dsl.platform.dao.GenericDao
delete, delete, evict, find, findAll, findByExample, get, load, merge, refresh, saveOrUpdate, update
 

Constructor Detail

CustomerDaoImpl

public CustomerDaoImpl()
Method Detail

setSessionFactory

public void setSessionFactory(@Qualifier(value="default")
                              org.hibernate.SessionFactory sessionFactory)
Overrides:
setSessionFactory in class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Customer,java.lang.String>
Parameters:
sessionFactory - the sessionFactory to set

setDataFieldMaxValueIncrementer

public void setDataFieldMaxValueIncrementer(@Qualifier(value="default")
                                            org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer dataFieldMaxValueIncrementer)
Overrides:
setDataFieldMaxValueIncrementer in class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Customer,java.lang.String>
Parameters:
dataFieldMaxValueIncrementer - the dataFieldMaxValueIncrementer to set

createEntity

public Customer createEntity(java.lang.Object context)
Specified by:
createEntity in interface org.openxma.dsl.platform.dao.EntityFactory<Customer>
Parameters:
context - the context for the object creation
Returns:
an instance of the entity matching the given name

create

public Customer create()
Description copied from interface: CustomerDao
Factory method to create an empty CustomerDao entity with an already assigned identifier. The advantage of this approach, coupled with the fact that we're using the id for equals, is that equality test's are immediately possible and therefore independent from the persistence state of the entity. This in contrast to other solutions where auto generated Keys are used which must wait until the object is persisted or differentiate between transient and managed states.

Specified by:
create in interface CustomerDao
Overrides:
create in class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Customer,java.lang.String>
Returns:
a new (non managed), empty CustomerDao entity with an already assigned identifier.

create

public Customer create(Address invoiceAddress,
                       Address deliveryAddress,
                       java.lang.String customerFirstName,
                       java.lang.String customerLastName,
                       java.lang.String emailAddress,
                       java.util.Date customerBirthDate)
Description copied from interface: CustomerDao
Factory method to create an empty CustomerDao taking all not null attributes.

Specified by:
create in interface CustomerDao
Returns:
a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database) CustomerDao entity with the given natural identifier and not null attributes set.

createAndSave

public Customer createAndSave(Address invoiceAddress,
                              Address deliveryAddress,
                              java.lang.String customerFirstName,
                              java.lang.String customerLastName,
                              java.lang.String emailAddress,
                              java.util.Date customerBirthDate)
Description copied from interface: CustomerDao
Factory method to create and save an empty CustomerDao taking all not null attributes.

Specified by:
createAndSave in interface CustomerDao
Returns:
a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database) CustomerDao entity with the given natural identifier and not null attributes set.

loadByCustomerNk

public Customer loadByCustomerNk(java.lang.String customerFirstName,
                                 java.lang.String customerLastName,
                                 java.util.Date customerBirthDate)
Description copied from interface: CustomerDao
Return the persistent instance of the Customer entity class with the given natural identifier or null if not found.

Specified by:
loadByCustomerNk in interface CustomerDao
Returns:
the persistent Customer instance, or null if not found

loadByCustomerUkEmail

public Customer loadByCustomerUkEmail(java.lang.String emailAddress)
Description copied from interface: CustomerDao
Return the persistent instance of the Customer entity class with the given unique-key or null if not found.

Specified by:
loadByCustomerUkEmail in interface CustomerDao
Returns:
the persistent Customer instance, or null if not found

findAllByFirstNameAndLastName

public java.util.List<Customer> findAllByFirstNameAndLastName(java.lang.String firstName,
                                                              java.lang.String lastName)
Description copied from interface: CustomerDao
Execute a query based on the given attributes.

Specified by:
findAllByFirstNameAndLastName in interface CustomerDao
Returns:
a List containing 0 or more persistent Customer instances

findAllByEmailAdressOrBirthDate

public java.util.List<Customer> findAllByEmailAdressOrBirthDate(java.lang.String emailAddress,
                                                                java.util.Date birthDate)
Description copied from interface: CustomerDao
Execute a query based on the given attributes.

Specified by:
findAllByEmailAdressOrBirthDate in interface CustomerDao
Returns:
a List containing 0 or more persistent Customer instances

findByFirstOrLastNameJoinOrder

public Customer findByFirstOrLastNameJoinOrder(java.lang.String firstName,
                                               java.lang.String lastName,
                                               StateAndDateQuery stateAndDateQuery)
Description copied from interface: CustomerDao
Execute a query based on the given attributes.

Specified by:
findByFirstOrLastNameJoinOrder in interface CustomerDao
Returns:
the persistent Customer instance matching the given attribute values, or null if not found

findAllByLastNameJoinOrdersDate

public java.util.List<Customer> findAllByLastNameJoinOrdersDate(java.lang.String lastName,
                                                                java.util.Date ordersPlacementDate)
Description copied from interface: CustomerDao
Execute a query based on the given attributes.

Specified by:
findAllByLastNameJoinOrdersDate in interface CustomerDao
Returns:
a List containing 0 or more persistent Customer instances

findByNamedQueryCustomerLastName

public java.util.List<Customer> findByNamedQueryCustomerLastName(java.lang.String lastName)
Specified by:
findByNamedQueryCustomerLastName in interface CustomerDao
Returns:
a List containing 0 or more persistent instances


Copyright © 2010. All Rights Reserved.