org.openxma.dsl.reference.dao.impl
Class OrderItemDaoImpl
java.lang.Object
org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<OrderItem,java.lang.String>
org.openxma.dsl.reference.dao.impl.OrderItemDaoImpl
- All Implemented Interfaces:
- org.openxma.dsl.platform.dao.EntityFactory<OrderItem>, org.openxma.dsl.platform.dao.FinderExecutor<OrderItem>, org.openxma.dsl.platform.dao.GenericDao<OrderItem,java.lang.String>, OrderItemDao
@Repository(value="orderItemDao")
public class OrderItemDaoImpl
- extends org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<OrderItem,java.lang.String>
- implements OrderItemDao
- See Also:
OrderItemDao
| Fields inherited from class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl |
argumentTypeFactory, dataFieldMaxValueIncrementer, logger, namingStrategy, sessionFactory, type |
| 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 |
OrderItemDaoImpl
public OrderItemDaoImpl()
setSessionFactory
public void setSessionFactory(@Qualifier(value="default")
org.hibernate.SessionFactory sessionFactory)
- Overrides:
setSessionFactory in class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<OrderItem,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<OrderItem,java.lang.String>
- Parameters:
dataFieldMaxValueIncrementer - the dataFieldMaxValueIncrementer to set
createEntity
public OrderItem createEntity(java.lang.Object context)
- Specified by:
createEntity in interface org.openxma.dsl.platform.dao.EntityFactory<OrderItem>
- Parameters:
context - the context for the object creation
- Returns:
- an instance of the entity matching the given name
create
public OrderItem create()
- Description copied from interface:
OrderItemDao
- Factory method to create an empty
OrderItemDao 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 OrderItemDao- Overrides:
create in class org.openxma.dsl.platform.dao.impl.GenericDaoHibernateImpl<OrderItem,java.lang.String>
- Returns:
- a new (non managed), empty
OrderItemDao entity with an already assigned identifier.
create
public OrderItem create(Order order,
Product product,
java.lang.Integer itemNo,
java.lang.Long quantity)
- Description copied from interface:
OrderItemDao
- Factory method to create an empty
OrderItemDao taking all not null attributes.
- Specified by:
create in interface OrderItemDao
- Returns:
- a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database)
OrderItemDao entity with the given natural identifier and not null attributes set.
createAndSave
public OrderItem createAndSave(Order order,
Product product,
java.lang.Integer itemNo,
java.lang.Long quantity)
- Description copied from interface:
OrderItemDao
- Factory method to create and save an empty
OrderItemDao taking all not null attributes.
- Specified by:
createAndSave in interface OrderItemDao
- Returns:
- a new, transient (i.e. is not associated with a persistence context and has no persistent representation in the database)
OrderItemDao entity with the given natural identifier and not null attributes set.
findByFindByQuantity
public OrderItem findByFindByQuantity(java.lang.Long quantity)
- Description copied from interface:
OrderItemDao
- Execute a query based on the given attributes.
- Specified by:
findByFindByQuantity in interface OrderItemDao
- Returns:
- the persistent OrderItem instance matching the given attribute values, or
null if not found
Copyright © 2010. All Rights Reserved.