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

java.lang.Object
  extended by org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Order,java.lang.String>
      extended by org.openxma.dsl.reference.dao.impl.AbstractOrderDaoImpl
All Implemented Interfaces:
org.openxma.dsl.platform.dao.EntityFactory<Order>, org.openxma.dsl.platform.dao.FinderExecutor<Order>, org.openxma.dsl.platform.dao.GenericDao<Order,java.lang.String>, OrderDao
Direct Known Subclasses:
OrderDaoImpl

public abstract class AbstractOrderDaoImpl
extends org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<Order,java.lang.String>
implements OrderDao

See Also:
OrderDao

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.OrderDao
AMOUNT_ASC, DATE_ASC
 
Constructor Summary
AbstractOrderDaoImpl()
           
 
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.
 Order createEntity(java.lang.Object context)
           
 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.
 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.reference.dao.OrderDao
findAllOrderStatesBetweenDate, readOrderStateByCustomerAndDate
 
Methods inherited from interface org.openxma.dsl.platform.dao.GenericDao
delete, delete, evict, find, findAll, findByExample, get, load, merge, refresh, saveOrUpdate, update
 

Constructor Detail

AbstractOrderDaoImpl

public AbstractOrderDaoImpl()
Method Detail

setSessionFactory

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

createEntity

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

create

public Order create()
Description copied from interface: OrderDao
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.

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

create

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

Specified by:
create in interface OrderDao
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

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

Specified by:
createAndSave in interface OrderDao
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

public Order loadByOrderUkOrderNumber(Customer customer,
                                      OrderNumber orderOrderNumber)
Description copied from interface: OrderDao
Return the persistent instance of the Order entity class with the given unique-key or null if not found.

Specified by:
loadByOrderUkOrderNumber in interface OrderDao
Returns:
the persistent Order instance, or null if not found

loadByOrderNk

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

Specified by:
loadByOrderNk in interface OrderDao
Returns:
the persistent Order instance, or null if not found

loadByOrderUkOrderNumber

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

Specified by:
loadByOrderUkOrderNumber in interface OrderDao
Returns:
the persistent Order instance, or null if not found

findByOrderNumber

public Order findByOrderNumber(OrderNumber orderNumber)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByOrderNumber in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found

findByCustomerStoreAndDate

public Order findByCustomerStoreAndDate(java.lang.String customerOid,
                                        java.lang.String storeId,
                                        java.util.Date placementDate)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByCustomerStoreAndDate in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found

findByCustomerLastNameOrOrderNumber

public Order findByCustomerLastNameOrOrderNumber(java.lang.String customerLastName,
                                                 OrderNumber orderNumber)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByCustomerLastNameOrOrderNumber in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found

findByCustomerOrOrderNumber

public Order findByCustomerOrOrderNumber(java.lang.String customerLastName,
                                         OrderNumber orderNumber)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByCustomerOrOrderNumber in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found

findByOrderNumberAndCustomerFirstName

public Order findByOrderNumberAndCustomerFirstName(OrderNumber orderNumber,
                                                   java.lang.String customerLastName)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByOrderNumberAndCustomerFirstName in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found

findByFindByStateAndDate

public Order findByFindByStateAndDate(java.lang.String orderState,
                                      java.util.Date placementDate,
                                      QuantityQuery quantityQuery)
Description copied from interface: OrderDao
Execute a query based on the given attributes.

Specified by:
findByFindByStateAndDate in interface OrderDao
Returns:
the persistent Order instance matching the given attribute values, or null if not found


Copyright © 2010. All Rights Reserved.