@Transactional public final class CategoryService extends Object implements ICategoryService
Modifier and Type | Method and Description |
---|---|
String |
doCreateCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
Creates a category.
|
void |
doDeleteCategory(int nIdCategory)
Deletes a category.
|
String |
doModifyCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
Modifies a category.
|
void |
doSaveCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
Modifies a category.
|
List<fr.paris.lutece.plugins.stock.business.category.Category> |
findAll()
Returns all.
|
List<fr.paris.lutece.plugins.stock.business.category.Category> |
findAll(List<String> orderList)
Return all category.
|
List<fr.paris.lutece.plugins.stock.business.category.Category> |
findAllChildrenWithChildren(Integer idCategory)
Finds all category's children and fetch children.
|
List<fr.paris.lutece.plugins.stock.business.category.Category> |
findAllFirstLevelWithChildren()
Finds all categories (first level) and fetch children.
|
fr.paris.lutece.plugins.stock.commons.ResultList<fr.paris.lutece.plugins.stock.business.category.Category> |
findByFilter(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter,
fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Finds by filter.
|
List<fr.paris.lutece.plugins.stock.business.category.Category> |
findByFilterWithChildren(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter)
Finds by filter and fetch children.
|
fr.paris.lutece.plugins.stock.business.category.Category |
findById(Integer nIdCategory)
Find by id.
|
fr.paris.lutece.plugins.stock.business.category.Category |
findByIdWithParent(Integer nIdCategory)
Finds a category and fetch parent.
|
fr.paris.lutece.plugins.stock.business.category.Category |
findByIdWithProduct(Integer nIdCategory)
Finds a category and fetch product.
|
fr.paris.lutece.plugins.stock.business.category.Category |
findByPrimarykeyWithChildren(Integer nIdCategory)
Finds a category and all his subcategories and fetch children.
|
fr.paris.lutece.plugins.stock.business.category.Category |
getCategory(int nIdCategory)
Get the category with the given id.
|
fr.paris.lutece.plugins.stock.business.category.Category |
getCategoryWithChildren(Integer idCategory)
Finds a category and all his subcategories and fetch children.
|
fr.paris.lutece.plugins.stock.business.category.Category |
getCategoryWithParent(int nIdCategory)
Finds a category and fetch parent.
|
static CategoryService |
getInstance()
Get an instance of
CategoryService . |
void |
init()
Init the object.
|
void |
update(fr.paris.lutece.plugins.stock.business.category.Category category)
Update the category.
|
public static CategoryService getInstance()
CategoryService
.CategoryService
public void init()
init
in interface ICategoryService
@Transactional public String doCreateCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
doCreateCategory
in interface ICategoryService
category
- The category to create in database@Transactional public String doModifyCategory(fr.paris.lutece.plugins.stock.business.category.Category category)
doModifyCategory
in interface ICategoryService
category
- The category to modify in database@Transactional public void doDeleteCategory(int nIdCategory)
doDeleteCategory
in interface ICategoryService
nIdCategory
- The category id to delete in databasepublic fr.paris.lutece.plugins.stock.business.category.Category getCategory(int nIdCategory)
getCategory
in interface ICategoryService
nIdCategory
- The category idpublic fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithParent(int nIdCategory)
getCategoryWithParent
in interface ICategoryService
nIdCategory
- the id of the searched categorypublic fr.paris.lutece.plugins.stock.business.category.Category getCategoryWithChildren(Integer idCategory)
getCategoryWithChildren
in interface ICategoryService
idCategory
- the id of upper categorypublic List<fr.paris.lutece.plugins.stock.business.category.Category> findAllFirstLevelWithChildren()
findAllFirstLevelWithChildren
in interface ICategoryService
public List<fr.paris.lutece.plugins.stock.business.category.Category> findAllChildrenWithChildren(Integer idCategory)
findAllChildrenWithChildren
in interface ICategoryService
idCategory
- the id of upper categorypublic fr.paris.lutece.plugins.stock.business.category.Category findByPrimarykeyWithChildren(Integer nIdCategory)
findByPrimarykeyWithChildren
in interface ICategoryService
nIdCategory
- the id of upper categorypublic fr.paris.lutece.plugins.stock.business.category.Category findByIdWithParent(Integer nIdCategory)
findByIdWithParent
in interface ICategoryService
nIdCategory
- the id of the searched categorypublic fr.paris.lutece.plugins.stock.business.category.Category findByIdWithProduct(Integer nIdCategory)
findByIdWithProduct
in interface ICategoryService
nIdCategory
- the id of the searched categorypublic List<fr.paris.lutece.plugins.stock.business.category.Category> findByFilterWithChildren(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter)
findByFilterWithChildren
in interface ICategoryService
filter
- the filterpublic fr.paris.lutece.plugins.stock.commons.ResultList<fr.paris.lutece.plugins.stock.business.category.Category> findByFilter(fr.paris.lutece.plugins.stock.business.category.CategoryFilter filter, fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
findByFilter
in interface ICategoryService
filter
- the filterpaginationProperties
- the pagination propertiespublic List<fr.paris.lutece.plugins.stock.business.category.Category> findAll()
findAll
in interface ICategoryService
public fr.paris.lutece.plugins.stock.business.category.Category findById(Integer nIdCategory)
findById
in interface ICategoryService
nIdCategory
- the n id categorypublic void update(fr.paris.lutece.plugins.stock.business.category.Category category)
update
in interface ICategoryService
category
- the categorypublic void doSaveCategory(fr.paris.lutece.plugins.stock.business.category.Category category) throws fr.paris.lutece.plugins.stock.commons.exception.ValidationException
doSaveCategory
in interface ICategoryService
category
- The category to modify in databasefr.paris.lutece.plugins.stock.commons.exception.ValidationException
public List<fr.paris.lutece.plugins.stock.business.category.Category> findAll(List<String> orderList)
findAll
in interface ICategoryService
orderList
- list of orderCopyright © 2020 City of Paris. All rights reserved.