public interface ProductDao
ProductDao provides persistence access to Product instancesProduct| Modifier and Type | Method and Description |
|---|---|
Product |
create(ProductType productType)
Create a new
Product instance. |
void |
delete(Product product)
Remove the passed in product instance from the datastore
|
List<Product> |
findProductByURI(String key)
Look up a product that matches the given URI
|
List<Product> |
readActiveProductsByCategory(Long categoryId,
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
|
List<Product> |
readActiveProductsByCategory(Long categoryId,
Date currentDate,
int limit,
int offset) |
List<Product> |
readAllActiveProducts(Date currentDate)
Reads all products from the database that are currently active.
|
List<Product> |
readAllActiveProducts(int page,
int pageSize,
Date currentDate)
Reads all products from the database that are currently active.
|
List<ProductBundle> |
readAutomaticProductBundles()
Returns all active ProductBundles whose automatic property is true.
|
Long |
readCountAllActiveProducts(Date currentDate)
Returns the number of products that are currently active.
|
List<Product> |
readFilteredActiveProductsByCategory(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
Find all products whose start and end dates are before and after the passed in
date, who are related to the given category, match the given search criteria, and
are not marked as archived.
|
List<Product> |
readFilteredActiveProductsByQuery(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
Find all products whose start and end dates are before and after the passed in
date, who match the search string, match the given search criteria, and are not
marked as archived.
|
Product |
readProductById(Long productId)
Retrieve a
Product instance by its primary key |
List<Product> |
readProductsByCategory(Long categoryId)
Find all products related to the passed in category
|
List<Product> |
readProductsByCategory(Long categoryId,
int limit,
int offset)
Find all products related to the passed in category
|
List<Product> |
readProductsByIds(List<Long> productIds)
Retrieves a list of Product instances by their primary keys
|
List<Product> |
readProductsByName(String searchName)
Find all
Product instances whose name starts with
or is equal to the passed in search parameter |
List<Product> |
readProductsByName(String searchName,
int limit,
int offset)
Find a subset of
Product instances whose name starts with
or is equal to the passed in search parameter. |
Product |
save(Product product)
Persist a
Product instance to the datastore |
@Nonnull Product readProductById(@Nonnull Long productId)
Product instance by its primary keyproductId - the primary key of the productList<Product> readProductsByIds(@Nonnull List<Long> productIds)
productIds - the list of primary keys for products@Nonnull Product save(@Nonnull Product product)
Product instance to the datastoreproduct - the product instance@Nonnull List<Product> readProductsByName(@Nonnull String searchName)
Product instances whose name starts with
or is equal to the passed in search parametersearchName - the partial or whole name to match@Nonnull List<Product> readProductsByName(@Nonnull String searchName, @Nonnull int limit, @Nonnull int offset)
Product instances whose name starts with
or is equal to the passed in search parameter. RessearchName - limit - the maximum number of resultsoffset - the starting point in the record set@Nonnull List<Product> readActiveProductsByCategory(@Nonnull Long categoryId, @Nonnull Date currentDate)
categoryId - 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@Nonnull List<Product> readFilteredActiveProductsByCategory(Long categoryId, Date currentDate, ProductSearchCriteria searchCriteria)
categoryId - currentDate - searchCriteria - @Nonnull List<Product> readFilteredActiveProductsByQuery(String query, Date currentDate, ProductSearchCriteria searchCriteria)
query - currentDate - searchCriteria - @Nonnull List<Product> readActiveProductsByCategory(@Nonnull Long categoryId, @Nonnull Date currentDate, @Nonnull int limit, @Nonnull int offset)
@Nonnull List<Product> readProductsByCategory(@Nonnull Long categoryId)
categoryId - the primary key of the category to whom the resulting product list should be related@Nonnull List<Product> readProductsByCategory(@Nonnull Long categoryId, @Nonnull int limit, @Nonnull int offset)
categoryId - the primary key of the category to whom the resulting product list should be relatedlimit - the maximum number of results to returnoffset - the starting point in the record setvoid delete(@Nonnull Product product)
product - the product instance to removeProduct create(ProductType productType)
Product 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.common.persistence.EntityConfiguration">
<property name="entityContexts">
<list>
<value>classpath:myCompany-applicationContext-entity.xml</value>
</list>
</property>
</bean>
productType - 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.List<ProductBundle> readAutomaticProductBundles()
List<Product> findProductByURI(String key)
uri - - the relative URL to look up the Product byList<Product> readAllActiveProducts(@Nonnull Date currentDate)
currentDate - List<Product> readAllActiveProducts(int page, int pageSize, Date currentDate)
readAllActiveProducts(Date) in that this one will utilize database paging.
It will fetch results in pages. For example, if page = 3 and pageSize = 25, this method would
return rows 75-99 from the database.page - - the number of the page to get (0 indexed)pageSize - - the number of results per pagecurrentDate - Copyright © 2014. All rights reserved.