public interface CategoryDao
CategoryDao provides persistence access to Category instances.| Modifier and Type | Method and Description |
|---|---|
Category |
create()
Create a new
Category instance. |
void |
delete(Category category)
Removed the passed in
Category instance from the datastore |
Category |
findCategoryByURI(String uri) |
Long |
getCurrentDateResolution()
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
List<Category> |
readActiveSubCategoriesByCategory(Category category)
Retrieve a list of all active child categories of the passed in
Category instance. |
List<Category> |
readActiveSubCategoriesByCategory(Category category,
int limit,
int offset)
Retrieve a list of all active child categories of the passed in
Category instance. |
List<Category> |
readAllCategories()
Retrieve all categories in the datastore
|
List<Category> |
readAllCategories(int limit,
int offset)
Retrieve a subset of all categories
|
List<Category> |
readAllParentCategories() |
List<Product> |
readAllProducts()
Retrieve all products in the datastore
|
List<Product> |
readAllProducts(int limit,
int offset) |
List<Category> |
readAllSubCategories(Category category)
Retrieve a list of all child categories of the passed in
Category instance |
List<Category> |
readAllSubCategories(Category category,
int limit,
int offset)
Retrieve a list of all child categories of the passed in
Category instance |
List<Category> |
readCategoriesByName(String categoryName)
Retrieve a list of
Category instances by name. |
List<Category> |
readCategoriesByName(String categoryName,
int limit,
int offset) |
Category |
readCategoryById(Long categoryId)
Retrieve a
Category instance by its primary key |
Category |
readCategoryByName(String categoryName)
Deprecated.
|
Category |
save(Category category)
Persist a
Category 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 Category readCategoryById(@Nonnull Long categoryId)
Category instance by its primary keycategoryId - the primary key of the CategoryCategory at the specified primary key@Nonnull @Deprecated Category readCategoryByName(@Nonnull String categoryName)
Category instance by its name.
Broadleaf allows more than one category to have the same name. Calling
this method could produce an exception in such situations. Use
readCategoriesByName(String) instead.categoryName - the name of the categoryList<Category> readAllParentCategories()
@Nonnull List<Category> readCategoriesByName(@Nonnull String categoryName)
Category instances by name.categoryName - the name to search by@Nonnull List<Category> readCategoriesByName(@Nonnull String categoryName, int limit, int offset)
@Nonnull Category save(@Nonnull Category category)
Category instance to the datastorecategory - the Category instanceCategory after being persisted@Nonnull List<Category> readAllCategories()
Category instances in the datastore@Nonnull List<Category> readAllCategories(@Nonnull int limit, @Nonnull int offset)
limit - the maximum number of results, defaults to 20offset - the starting point in the record set, defaults to 0@Nonnull List<Product> readAllProducts()
Category instances in the datastore, regardless of their category association@Nonnull List<Category> readAllSubCategories(@Nonnull Category category)
Category instancecategory - the parent category@Nonnull List<Category> readAllSubCategories(@Nonnull Category category, @Nonnull int limit, @Nonnull int offset)
Category instancecategory - the parent categorylimit - the maximum number of results to returnoffset - the starting point in the record setvoid delete(@Nonnull Category category)
Category instance from the datastorecategory - the Category instance to remove@Nonnull Category create()
Category 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 Category to instantiate. To make Broadleaf instantiate your
extension of Category 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>
Category instance based on the Broadleaf entity configuration.@Nonnull List<Category> readActiveSubCategoriesByCategory(Category category)
Category instance.
This method bases its search on a current time value. To make the retrieval of values more
efficient, the current time is cached for a configurable amount of time. See
getCurrentDateResolution()category - the parent category@Nonnull List<Category> readActiveSubCategoriesByCategory(@Nonnull Category category, @Nonnull int limit, @Nonnull int offset)
Category instance.
This method bases its search on a current time value. To make the retrieval of values more
efficient, the current time is cached for a configurable amount of time. See
getCurrentDateResolution()category - the parent categorylimit - the maximum number of results to returnoffset - the starting point in the record setLong getCurrentDateResolution()
void setCurrentDateResolution(Long currentDateResolution)
currentDateResolution - the milliseconds to cache the current date/timeCopyright © 2014. All Rights Reserved.