|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.catalog.dao.ProductDaoImpl
@Repository(value="blProductDao") public class ProductDaoImpl
| Field Summary | |
|---|---|
protected java.lang.Long |
currentDateResolution
|
protected javax.persistence.EntityManager |
em
|
protected EntityConfiguration |
entityConfiguration
|
| Constructor Summary | |
|---|---|
ProductDaoImpl()
|
|
| Method Summary | |
|---|---|
Product |
create(ProductType productType)
Create a new Product instance. |
void |
delete(Product product)
Remove the passed in product instance from the datastore |
java.lang.Long |
getCurrentDateResolution()
|
java.util.List<Product> |
readActiveProductsByCategory(java.lang.Long categoryId,
java.util.Date currentDate)
Find all products whose start and end dates are before and after the passed in date and who are related to the given category |
java.util.List<Product> |
readActiveProductsBySku(java.lang.Long skuId,
java.util.Date currentDate)
Find all products whose start and end dates are before and after the passed in date and who are related to the given sku. |
java.util.List<ProductSku> |
readActiveProductsBySkuOneToOne(java.lang.Long skuId,
java.util.Date currentDate)
Find all the ProductSku instances whose start and end dates are before and after the passed in
date and who are related to the given sku. |
Product |
readProductById(java.lang.Long productId)
Retrieve a Product instance by its primary key |
java.util.List<Product> |
readProductsByCategory(java.lang.Long categoryId)
Find all products related to the passed in category |
java.util.List<Product> |
readProductsByName(java.lang.String searchName)
Find all Product instances whose name starts with
or is equal to the passed in search parameter |
java.util.List<Product> |
readProductsBySku(java.lang.Long skuId)
Find all the products related to the passed in sku |
java.util.List<ProductSku> |
readProductsBySkuOneToOne(java.lang.Long skuId)
Find all the ProductSku instances related to the passed in sku. |
Product |
save(Product product)
Persist a Product instance to the datastore |
void |
setCurrentDateResolution(java.lang.Long currentDateResolution)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected java.lang.Long currentDateResolution
| Constructor Detail |
|---|
public ProductDaoImpl()
| Method Detail |
|---|
public Product save(Product product)
ProductDaoProduct instance to the datastore
save in interface ProductDaoproduct - the product instance
public Product readProductById(java.lang.Long productId)
ProductDaoProduct instance by its primary key
readProductById in interface ProductDaoproductId - the primary key of the product
public java.util.List<Product> readProductsByName(java.lang.String searchName)
ProductDaoProduct instances whose name starts with
or is equal to the passed in search parameter
readProductsByName in interface ProductDaosearchName - the partial or whole name to match
public java.util.List<Product> readActiveProductsByCategory(java.lang.Long categoryId,
java.util.Date currentDate)
ProductDao
readActiveProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be relatedcurrentDate - the date for which the products should be checked against to determine their active state
public java.util.List<Product> readProductsByCategory(java.lang.Long categoryId)
ProductDao
readProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be related
public java.util.List<Product> readProductsBySku(java.lang.Long skuId)
ProductDao
readProductsBySku in interface ProductDaoskuId - the primary key of the sku to whom the resulting product list should be related
Product and Sku.public java.util.List<ProductSku> readProductsBySkuOneToOne(java.lang.Long skuId)
ProductDaoProductSku instances related to the passed in sku. Use this method if your
product domain is modelled with a OneToOne relationship between Product and Sku.
readProductsBySkuOneToOne in interface ProductDaoskuId - the primary key of the sku to whom the resulting ProductSku list should be related
ProductSku instances qualified for the sku
public java.util.List<Product> readActiveProductsBySku(java.lang.Long skuId,
java.util.Date currentDate)
ProductDaoProduct and Sku.
readActiveProductsBySku in interface ProductDaoskuId - the primary key of the sku to whom the resulting product list should be relatedcurrentDate - the date for which the products should be checked against to determine their active state
public java.util.List<ProductSku> readActiveProductsBySkuOneToOne(java.lang.Long skuId,
java.util.Date currentDate)
ProductDaoProductSku instances whose start and end dates are before and after the passed in
date and who are related to the given sku. Use this method if your product domain is modelled
with a OneToOne relationship between Product and Sku.
readActiveProductsBySkuOneToOne in interface ProductDaoskuId - the primary key of the sku to whom the resulting ProductSku list should be relatedcurrentDate - the date for which the ProductSku instances should be checked against to determine their active state
ProductSku instances qualifed for the sku and datepublic void delete(Product product)
ProductDao
delete in interface ProductDaoproduct - the product instance to removepublic Product create(ProductType productType)
ProductDaoProduct instance. The system will use the configuration in
/BroadleafCommerce/core/BroadleafCommerceFramework/src/main/resources/bl-framework-applicationContext-entity.xml
to determine which polymorphic version of Product to instantiate. To make Broadleaf instantiate your
extension of Product by default, include an entity configuration bean in your application context xml similar to:
<bean id="blEntityConfiguration" class="org.broadleafcommerce.persistence.EntityConfiguration">
<property name="entityContexts">
<list>
<value>classpath:myCompany-applicationContext-entity.xml</value>
</list>
</property>
</bean>
create in interface ProductDaoproductType - the type of product you would like to create (presumably a Product or ProductSku instance). The getType method of ProductType provides the key for the entity configuration.
Product instance based on the Broadleaf entity configuration.public java.lang.Long getCurrentDateResolution()
public void setCurrentDateResolution(java.lang.Long currentDateResolution)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||