org.openxma.dsl.reference.dao
Interface CustomerDao

All Superinterfaces:
org.openxma.dsl.platform.dao.EntityFactory<Customer>, org.openxma.dsl.platform.dao.GenericDao<Customer,java.lang.String>
All Known Implementing Classes:
CustomerDaoImpl

public interface CustomerDao
extends org.openxma.dsl.platform.dao.GenericDao<Customer,java.lang.String>, org.openxma.dsl.platform.dao.EntityFactory<Customer>

Represents a Data Access Object, as defined in the Core J2EE Pattern Catalog (see http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html), to abstract and encapsulate all access to entity CustomerDao.

See Also:
CustomerDao

Field Summary
static org.openxma.dsl.platform.dao.SortOrderSpecification LAST_NAME_ASC
           
 
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.
 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.
 
Methods inherited from interface org.openxma.dsl.platform.dao.GenericDao
delete, delete, evict, find, findAll, findByExample, get, load, merge, refresh, saveOrUpdate, update
 
Methods inherited from interface org.openxma.dsl.platform.dao.EntityFactory
createEntity
 

Field Detail

LAST_NAME_ASC

static final org.openxma.dsl.platform.dao.SortOrderSpecification LAST_NAME_ASC
Method Detail

create

Customer create()
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.

Returns:
a new (non managed), empty CustomerDao entity with an already assigned identifier.

create

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.

Parameters:
invoiceAddress -
deliveryAddress -
firstName -
lastName -
emailAddress -
birthDate -
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

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.

Parameters:
invoiceAddress -
deliveryAddress -
firstName -
lastName -
emailAddress -
birthDate -
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

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.

Parameters:
firstName -
lastName -
birthDate -
Returns:
the persistent Customer instance, or null if not found

loadByCustomerUkEmail

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.

Parameters:
emailAddress -
Returns:
the persistent Customer instance, or null if not found

findAllByFirstNameAndLastName

java.util.List<Customer> findAllByFirstNameAndLastName(java.lang.String firstName,
                                                       java.lang.String lastName)
Execute a query based on the given attributes.

Returns:
a List containing 0 or more persistent Customer instances

findAllByEmailAdressOrBirthDate

java.util.List<Customer> findAllByEmailAdressOrBirthDate(java.lang.String emailAddress,
                                                         java.util.Date birthDate)
Execute a query based on the given attributes.

Returns:
a List containing 0 or more persistent Customer instances

findByFirstOrLastNameJoinOrder

Customer findByFirstOrLastNameJoinOrder(java.lang.String firstName,
                                        java.lang.String lastName,
                                        StateAndDateQuery stateAndDateQuery)
Execute a query based on the given attributes.

Returns:
the persistent Customer instance matching the given attribute values, or null if not found

findAllByLastNameJoinOrdersDate

java.util.List<Customer> findAllByLastNameJoinOrdersDate(java.lang.String lastName,
                                                         java.util.Date ordersPlacementDate)
Execute a query based on the given attributes.

Returns:
a List containing 0 or more persistent Customer instances

findByNamedQueryCustomerLastName

java.util.List<Customer> findByNamedQueryCustomerLastName(java.lang.String lastName)
Parameters:
lastName -
Returns:
a List containing 0 or more persistent instances


Copyright © 2010. All Rights Reserved.