|
||||||||||
| 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 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 |
java.util.List<Category> |
readAllCategories()
Retrieve all categories in the datastore |
java.util.List<Product> |
readAllProducts()
Retrieve all products in the datastore |
java.util.List<Category> |
readAllSubCategories(Category category)
Retrieve a list of all child categories of the passed in Category instance |
java.util.List<Category> |
readCategoriesByName(java.lang.String categoryName)
Retrieve a list of Category instances by name. |
Category |
readCategoryById(java.lang.Long categoryId)
Retrieve a Category instance by its primary key |
Category |
readCategoryByName(java.lang.String categoryName)
Deprecated. |
Category |
save(Category category)
Persist a Category instance to the datastore |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
| Constructor Detail |
|---|
public CategoryDaoImpl()
| Method Detail |
|---|
public Category save(Category category)
CategoryDaoCategory instance to the datastore
save in interface CategoryDaocategory - the Category instance
Category after being persistedpublic Category readCategoryById(java.lang.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(java.lang.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 java.util.List<Category> readCategoriesByName(java.lang.String categoryName)
CategoryDaoCategory instances by name.
readCategoriesByName in interface CategoryDaocategoryName - the name to search by
public java.util.List<Category> readAllCategories()
CategoryDao
readAllCategories in interface CategoryDaoCategory instances in the datastorepublic java.util.List<Product> readAllProducts()
CategoryDao
readAllProducts in interface CategoryDaoCategory instances in the datastore, regardless of their category associationpublic java.util.List<Category> readAllSubCategories(Category category)
CategoryDaoCategory instance
readAllSubCategories in interface CategoryDaocategory - the parent category
public 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.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||