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
|
Long |
getCurrentDateResolution()
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
List<Product> |
readActiveProductsByCategory(Long categoryId)
Find all products whose in the passed in category.
|
List<Product> |
readActiveProductsByCategory(Long categoryId,
Date currentDate)
Deprecated.
Use
readActiveProductsByCategory(Long)
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)
Deprecated.
|
List<Product> |
readActiveProductsByCategory(Long categoryId,
int limit,
int offset)
Read a page of products for a category.
|
List<Product> |
readAllActiveProducts()
Reads all products from the database that are currently active.
|
List<Product> |
readAllActiveProducts(Date currentDate)
Deprecated.
|
List<Product> |
readAllActiveProducts(int page,
int pageSize)
Reads all products from the database that are currently active.
|
List<Product> |
readAllActiveProducts(int page,
int pageSize,
Date currentDate)
Deprecated.
Use
#readAllActiveProducts(page, pageSize) |
List<ProductBundle> |
readAutomaticProductBundles()
Returns all active ProductBundles whose automatic property is true.
|
Long |
readCountAllActiveProducts()
Returns the number of products that are currently active.
|
Long |
readCountAllActiveProducts(Date currentDate)
Deprecated.
#readActiveProductCount() |
List<Product> |
readFilteredActiveProductsByCategory(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
Deprecated.
Use
readFilteredActiveProductsByCategory(Long, ProductSearchCriteria)
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> |
readFilteredActiveProductsByCategory(Long categoryId,
ProductSearchCriteria searchCriteria)
Find all active products that 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)
Deprecated.
Use
readFilteredActiveProductsByQuery(String, ProductSearchCriteria)
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. |
List<Product> |
readFilteredActiveProductsByQuery(String query,
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 |
void |
setCurrentDateResolution(Long currentDateResolution)
Sets the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
@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 setList<Product> readActiveProductsByCategory(@Nonnull Long categoryId)
categoryId - the primary key of the category to whom the resulting product list should be relatedList<Product> readActiveProductsByCategory(@Nonnull Long categoryId, @Nonnull int limit, @Nonnull int offset)
categoryId - limit - offset - @Nonnull List<Product> readFilteredActiveProductsByCategory(Long categoryId, ProductSearchCriteria searchCriteria)
categoryId - searchCriteria - @Nonnull List<Product> readFilteredActiveProductsByQuery(String query, ProductSearchCriteria searchCriteria)
query - searchCriteria - @Nonnull List<Product> readFilteredActiveProductsByCategory(Long categoryId, Date currentDate, ProductSearchCriteria searchCriteria)
readFilteredActiveProductsByCategory(Long, ProductSearchCriteria)
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.categoryId - currentDate - searchCriteria - @Nonnull List<Product> readActiveProductsByCategory(@Nonnull Long categoryId, @Nonnull Date currentDate)
readActiveProductsByCategory(Long)
Find all products whose start and end dates are before and after the passed in
date and who are related to the given categorycategoryId - 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> readFilteredActiveProductsByQuery(String query, Date currentDate, ProductSearchCriteria searchCriteria)
readFilteredActiveProductsByQuery(String, ProductSearchCriteria)
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.query - currentDate - searchCriteria - @Nonnull List<Product> readActiveProductsByCategory(@Nonnull Long categoryId, @Nonnull Date currentDate, @Nonnull int limit, @Nonnull int offset)
readActiveProductsByCategory(Long)@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()
List<Product> readAllActiveProducts(@Nonnull Date currentDate)
readAllActiveProducts()currentDate - List<Product> readAllActiveProducts(int page, int pageSize)
readAllActiveProducts() 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 pageList<Product> readAllActiveProducts(int page, int pageSize, Date currentDate)
#readAllActiveProducts(page, pageSize)page - - the number of the page to get (0 indexed)pageSize - - the number of results per pagecurrentDate - Long readCountAllActiveProducts()
Long readCountAllActiveProducts(Date currentDate)
#readActiveProductCount()currentDate - Long getCurrentDateResolution()
void setCurrentDateResolution(Long currentDateResolution)
currentDateResolution - the milliseconds to cache the current date/timeCopyright © 2014. All Rights Reserved.