@Repository(value="blCategoryDao") public class CategoryDaoImpl extends Object implements CategoryDao
| Modifier and Type | Field and Description |
|---|---|
protected Date |
cachedDate |
protected Long |
currentDateResolution |
protected javax.persistence.EntityManager |
em |
protected EntityConfiguration |
entityConfiguration |
| Constructor and Description |
|---|
CategoryDaoImpl() |
| 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) |
protected Date |
getCurrentDateAfterFactoringInDateResolution() |
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.
|
protected Long currentDateResolution
protected Date cachedDate
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected Date getCurrentDateAfterFactoringInDateResolution()
public Category save(Category category)
CategoryDaoCategory instance to the datastoresave in interface CategoryDaocategory - the Category instanceCategory after being persistedpublic Category readCategoryById(Long categoryId)
CategoryDaoCategory instance by its primary keyreadCategoryById in interface CategoryDaocategoryId - the primary key of the CategoryCategory at the specified primary key@Deprecated public Category readCategoryByName(String categoryName)
CategoryDaoCategory 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
CategoryDao.readCategoriesByName(String) instead.readCategoryByName in interface CategoryDaocategoryName - the name of the categorypublic List<Category> readAllParentCategories()
readAllParentCategories in interface CategoryDaopublic List<Category> readCategoriesByName(String categoryName)
CategoryDaoCategory instances by name.readCategoriesByName in interface CategoryDaocategoryName - the name to search bypublic List<Category> readCategoriesByName(String categoryName, int limit, int offset)
readCategoriesByName in interface CategoryDaopublic List<Category> readAllCategories()
CategoryDaoreadAllCategories in interface CategoryDaoCategory instances in the datastorepublic List<Category> readAllCategories(int limit, int offset)
CategoryDaoreadAllCategories in interface CategoryDaolimit - the maximum number of results, defaults to 20offset - the starting point in the record set, defaults to 0public List<Product> readAllProducts()
CategoryDaoreadAllProducts in interface CategoryDaoCategory instances in the datastore, regardless of their category associationpublic List<Product> readAllProducts(int limit, int offset)
readAllProducts in interface CategoryDaopublic List<Category> readAllSubCategories(Category category)
CategoryDaoCategory instancereadAllSubCategories in interface CategoryDaocategory - the parent categorypublic List<Category> readAllSubCategories(Category category, int limit, int offset)
CategoryDaoCategory instancereadAllSubCategories in interface CategoryDaocategory - the parent categorylimit - the maximum number of results to returnoffset - the starting point in the record setpublic List<Category> readActiveSubCategoriesByCategory(Category category)
CategoryDaoCategory 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
CategoryDao.getCurrentDateResolution()readActiveSubCategoriesByCategory in interface CategoryDaocategory - the parent categorypublic List<Category> readActiveSubCategoriesByCategory(Category category, int limit, int offset)
CategoryDaoCategory 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
CategoryDao.getCurrentDateResolution()readActiveSubCategoriesByCategory in interface CategoryDaocategory - the parent categorylimit - the maximum number of results to returnoffset - the starting point in the record setpublic Long getCurrentDateResolution()
CategoryDaogetCurrentDateResolution in interface CategoryDaopublic void setCurrentDateResolution(Long currentDateResolution)
CategoryDaosetCurrentDateResolution in interface CategoryDaocurrentDateResolution - the milliseconds to cache the current date/timepublic void delete(Category category)
CategoryDaoCategory instance from the datastoredelete in interface CategoryDaocategory - the Category instance to removepublic Category create()
CategoryDaoCategory 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>
create in interface CategoryDaoCategory instance based on the Broadleaf entity configuration.public Category findCategoryByURI(String uri)
findCategoryByURI in interface CategoryDaoCopyright © 2014. All Rights Reserved.