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
|
java.util.List<Product> |
findProductByURI(java.lang.String key)
Look up a product that matches the given URI
|
java.lang.Long |
getCurrentDateResolution()
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
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> |
readActiveProductsByCategory(java.lang.Long categoryId,
java.util.Date currentDate,
int limit,
int offset) |
java.util.List<Product> |
readAllActiveProducts(java.util.Date currentDate)
Reads all products from the database that are currently active.
|
java.util.List<Product> |
readAllActiveProducts(int page,
int pageSize,
java.util.Date currentDate)
Reads all products from the database that are currently active.
|
java.util.List<ProductBundle> |
readAutomaticProductBundles()
Returns all active ProductBundles whose automatic property is true.
|
java.lang.Long |
readCountAllActiveProducts(java.util.Date currentDate)
Returns the number of products that are currently active.
|
java.util.List<Product> |
readFilteredActiveProductsByCategory(java.lang.Long categoryId,
java.util.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.
|
java.util.List<Product> |
readFilteredActiveProductsByQuery(java.lang.String query,
java.util.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(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> |
readProductsByCategory(java.lang.Long categoryId,
int limit,
int offset)
Find all products related to the passed in category
|
java.util.List<Product> |
readProductsByIds(java.util.List<java.lang.Long> productIds)
Retrieves a list of Product instances by their primary keys
|
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> |
readProductsByName(java.lang.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(java.lang.Long currentDateResolution)
Sets the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
@Nonnull Product readProductById(@Nonnull java.lang.Long productId)
Product instance by its primary keyproductId - the primary key of the productjava.util.List<Product> readProductsByIds(@Nonnull java.util.List<java.lang.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 java.util.List<Product> readProductsByName(@Nonnull java.lang.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 java.util.List<Product> readProductsByName(@Nonnull java.lang.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 java.util.List<Product> readActiveProductsByCategory(@Nonnull java.lang.Long categoryId, @Nonnull java.util.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 java.util.List<Product> readFilteredActiveProductsByCategory(java.lang.Long categoryId, java.util.Date currentDate, ProductSearchCriteria searchCriteria)
categoryId - currentDate - searchCriteria - @Nonnull java.util.List<Product> readFilteredActiveProductsByQuery(java.lang.String query, java.util.Date currentDate, ProductSearchCriteria searchCriteria)
query - currentDate - searchCriteria - @Nonnull java.util.List<Product> readActiveProductsByCategory(@Nonnull java.lang.Long categoryId, @Nonnull java.util.Date currentDate, @Nonnull int limit, @Nonnull int offset)
@Nonnull java.util.List<Product> readProductsByCategory(@Nonnull java.lang.Long categoryId)
categoryId - the primary key of the category to whom the resulting product list should be related@Nonnull java.util.List<Product> readProductsByCategory(@Nonnull java.lang.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.java.util.List<ProductBundle> readAutomaticProductBundles()
java.util.List<Product> findProductByURI(java.lang.String key)
uri - - the relative URL to look up the Product byjava.util.List<Product> readAllActiveProducts(@Nonnull java.util.Date currentDate)
currentDate - java.util.List<Product> readAllActiveProducts(int page, int pageSize, java.util.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 - java.lang.Long readCountAllActiveProducts(java.util.Date currentDate)
currentDate - java.lang.Long getCurrentDateResolution()
void setCurrentDateResolution(java.lang.Long currentDateResolution)
currentDateResolution - the milliseconds to cache the current date/timeCopyright © 2018. All Rights Reserved.