org.openxma.dsl.reference.dao
Interface OrderDao

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

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

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 OrderDao.

See Also:
OrderDao

Field Summary
static org.openxma.dsl.platform.dao.SortOrderSpecification AMOUNT_ASC
           
static org.openxma.dsl.platform.dao.SortOrderSpecification DATE_ASC
           
 
Method Summary
 Order create()
          Factory method to create an empty OrderDao entity with an already assigned identifier.
 Order create(Customer customer, OrderNumber orderOrderNumber, java.lang.String storeId, java.util.Date placementDate, java.lang.String orderState, java.lang.Double totalAmount)
          Factory method to create an empty OrderDao taking all not null attributes.
 Order createAndSave(Customer customer, OrderNumber orderOrderNumber, java.lang.String storeId, java.util.Date placementDate, java.lang.String orderState, java.lang.Double totalAmount)
          Factory method to create and save an empty OrderDao taking all not null attributes.
 java.util.Set<Order> findAllOrderStatesBetweenDate(Order order, java.util.Date from, java.util.Date to)
           
 Order findByCustomerLastNameOrOrderNumber(java.lang.String customerLastName, OrderNumber orderNumber)
          Execute a query based on the given attributes.
 Order findByCustomerOrOrderNumber(java.lang.String customerLastName, OrderNumber orderNumber)
          Execute a query based on the given attributes.
 Order findByCustomerStoreAndDate(java.lang.String customerOid, java.lang.String storeId, java.util.Date placementDate)
          Execute a query based on the given attributes.
 Order findByFindByStateAndDate(java.lang.String orderState, java.util.Date placementDate, QuantityQuery quantityQuery)
          Execute a query based on the given attributes.
 Order findByOrderNumber(OrderNumber orderNumber)
          Execute a query based on the given attributes.
 Order findByOrderNumberAndCustomerFirstName(OrderNumber orderNumber, java.lang.String customerLastName)
          Execute a query based on the given attributes.
 Order loadByOrderNk(java.lang.String customerFirstName, java.lang.String customerLastName, java.util.Date customerBirthDate, java.lang.String storeId, java.util.Date placementDate)
          Return the persistent instance of the Order entity class with the given natural identifier or null if not found.
 Order loadByOrderUkOrderNumber(Customer customer, OrderNumber orderOrderNumber)
          Return the persistent instance of the Order entity class with the given unique-key or null if not found.
 Order loadByOrderUkOrderNumber(java.lang.String customerOid, OrderNumber orderNumber)
          Return the persistent instance of the Order entity class with the given unique-key or null if not found.
 java.util.List<OrderStateView> readOrderStateByCustomerAndDate(java.lang.Long customerId, java.util.Date reportDate)
           
 
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

DATE_ASC

static final org.openxma.dsl.platform.dao.SortOrderSpecification DATE_ASC

AMOUNT_ASC

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

create

Order create()
Factory method to create an empty OrderDao 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 OrderDao entity with an already assigned identifier.

create

Order create(Customer customer,
             OrderNumber orderOrderNumber,
             java.lang.String storeId,
             java.util.Date placementDate,
             java.lang.String orderState,
             java.lang.Double totalAmount)
Factory method to create an empty OrderDao taking all not null attributes.

Parameters:
customer -
orderNumber -
storeId -
placementDate -
orderState -
totalAmount -
Returns:
a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database) OrderDao entity with the given natural identifier and not null attributes set.

createAndSave

Order createAndSave(Customer customer,
                    OrderNumber orderOrderNumber,
                    java.lang.String storeId,
                    java.util.Date placementDate,
                    java.lang.String orderState,
                    java.lang.Double totalAmount)
Factory method to create and save an empty OrderDao taking all not null attributes.

Parameters:
customer -
orderNumber -
storeId -
placementDate -
orderState -
totalAmount -
Returns:
a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database) OrderDao entity with the given natural identifier and not null attributes set.

loadByOrderUkOrderNumber

Order loadByOrderUkOrderNumber(Customer customer,
                               OrderNumber orderOrderNumber)
Return the persistent instance of the Order entity class with the given unique-key or null if not found.

Parameters:
customer -
orderNumber -
Returns:
the persistent Order instance, or null if not found

loadByOrderNk

Order loadByOrderNk(java.lang.String customerFirstName,
                    java.lang.String customerLastName,
                    java.util.Date customerBirthDate,
                    java.lang.String storeId,
                    java.util.Date placementDate)
Return the persistent instance of the Order entity class with the given natural identifier or null if not found.

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

loadByOrderUkOrderNumber

Order loadByOrderUkOrderNumber(java.lang.String customerOid,
                               OrderNumber orderNumber)
Return the persistent instance of the Order entity class with the given unique-key or null if not found.

Parameters:
oid -
orderNumber -
Returns:
the persistent Order instance, or null if not found

findByOrderNumber

Order findByOrderNumber(OrderNumber orderNumber)
Execute a query based on the given attributes.

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

findByCustomerStoreAndDate

Order findByCustomerStoreAndDate(java.lang.String customerOid,
                                 java.lang.String storeId,
                                 java.util.Date placementDate)
Execute a query based on the given attributes.

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

findByCustomerLastNameOrOrderNumber

Order findByCustomerLastNameOrOrderNumber(java.lang.String customerLastName,
                                          OrderNumber orderNumber)
Execute a query based on the given attributes.

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

findByCustomerOrOrderNumber

Order findByCustomerOrOrderNumber(java.lang.String customerLastName,
                                  OrderNumber orderNumber)
Execute a query based on the given attributes.

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

findByOrderNumberAndCustomerFirstName

Order findByOrderNumberAndCustomerFirstName(OrderNumber orderNumber,
                                            java.lang.String customerLastName)
Execute a query based on the given attributes.

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

findByFindByStateAndDate

Order findByFindByStateAndDate(java.lang.String orderState,
                               java.util.Date placementDate,
                               QuantityQuery quantityQuery)
Execute a query based on the given attributes.

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

readOrderStateByCustomerAndDate

java.util.List<OrderStateView> readOrderStateByCustomerAndDate(java.lang.Long customerId,
                                                               java.util.Date reportDate)
Parameters:
customerId -
reportDate -
Returns:
a List containing 0 or more persistent instances

findAllOrderStatesBetweenDate

java.util.Set<Order> findAllOrderStatesBetweenDate(Order order,
                                                   java.util.Date from,
                                                   java.util.Date to)
Parameters:
order -
from -
to -
Returns:
a Set containing 0 or more persistent instances


Copyright © 2010. All Rights Reserved.