org.openxma.dsl.reference.dao
Interface OrderItemDao

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

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

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

See Also:
OrderItemDao

Method Summary
 OrderItem create()
          Factory method to create an empty OrderItemDao entity with an already assigned identifier.
 OrderItem create(Order order, Product product, java.lang.Integer itemNo, java.lang.Long quantity)
          Factory method to create an empty OrderItemDao taking all not null attributes.
 OrderItem createAndSave(Order order, Product product, java.lang.Integer itemNo, java.lang.Long quantity)
          Factory method to create and save an empty OrderItemDao taking all not null attributes.
 OrderItem findByFindByQuantity(java.lang.Long quantity)
          Execute a query based on the given attributes.
 
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
 

Method Detail

create

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

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

create

OrderItem create(Order order,
                 Product product,
                 java.lang.Integer itemNo,
                 java.lang.Long quantity)
Factory method to create an empty OrderItemDao taking all not null attributes.

Parameters:
order -
product -
itemNo -
quantity -
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

OrderItem createAndSave(Order order,
                        Product product,
                        java.lang.Integer itemNo,
                        java.lang.Long quantity)
Factory method to create and save an empty OrderItemDao taking all not null attributes.

Parameters:
order -
product -
itemNo -
quantity -
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

OrderItem findByFindByQuantity(java.lang.Long quantity)
Execute a query based on the given attributes.

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


Copyright © 2010. All Rights Reserved.