|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.catalog.dao.CategoryDaoImpl
@Repository(value="blCategoryDao") public class CategoryDaoImpl
| Field Summary | |
|---|---|
protected Date |
cachedDate
|
protected Long |
currentDateResolution
|
protected javax.persistence.EntityManager |
em
|
protected EntityConfiguration |
entityConfiguration
|
| Constructor Summary | |
|---|---|
CategoryDaoImpl()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Long currentDateResolution
protected Date cachedDate
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
| Constructor Detail |
|---|
public CategoryDaoImpl()
| Method Detail |
|---|
protected Date getCurrentDateAfterFactoringInDateResolution()
public Category save(Category category)
CategoryDaoCategory instance to the datastore
save in interface CategoryDaocategory - the Category instance
Category after being persistedpublic Category readCategoryById(Long categoryId)
CategoryDaoCategory instance by its primary key
readCategoryById in interface CategoryDaocategoryId - the primary key of the Category
Category 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 category
public List<Category> readAllParentCategories()
readAllParentCategories in interface CategoryDaopublic List<Category> readCategoriesByName(String categoryName)
CategoryDaoCategory instances by name.
readCategoriesByName in interface CategoryDaocategoryName - the name to search by
public List<Category> readCategoriesByName(String categoryName,
int limit,
int offset)
readCategoriesByName in interface CategoryDaopublic List<Category> readAllCategories()
CategoryDao
readAllCategories in interface CategoryDaoCategory instances in the datastore
public List<Category> readAllCategories(int limit,
int offset)
CategoryDao
readAllCategories in interface CategoryDaolimit - the maximum number of results, defaults to 20offset - the starting point in the record set, defaults to 0
public List<Product> readAllProducts()
CategoryDao
readAllProducts in interface CategoryDaoCategory instances in the datastore, regardless of their category association
public List<Product> readAllProducts(int limit,
int offset)
readAllProducts in interface CategoryDaopublic List<Category> readAllSubCategories(Category category)
CategoryDaoCategory instance
readAllSubCategories in interface CategoryDaocategory - the parent category
public List<Category> readAllSubCategories(Category category,
int limit,
int offset)
CategoryDaoCategory instance
readAllSubCategories in interface CategoryDaocategory - the parent categorylimit - the maximum number of results to returnoffset - the starting point in the record set
public 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 category
public 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 set
public Long getCurrentDateResolution()
CategoryDao
getCurrentDateResolution in interface CategoryDaopublic void setCurrentDateResolution(Long currentDateResolution)
CategoryDao
setCurrentDateResolution in interface CategoryDaocurrentDateResolution - the milliseconds to cache the current date/timepublic void delete(Category category)
CategoryDaoCategory instance from the datastore
delete 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 CategoryDao
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||