Package org.silverpeas.core.mylinks.dao
Class CategoryDAO
- java.lang.Object
-
- org.silverpeas.core.mylinks.dao.CategoryDAO
-
@Repository public class CategoryDAO extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CategoryDAO()
Hide constructor of utility class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CategoryDetail
create(CategoryDetail category)
Create new categoryvoid
deleteCategory(int id)
Remove a categoryvoid
deleteUserData(String userId)
Deletes all categories created by a user.List<CategoryDetail>
getAllCategoriesByUser(String userId)
Retrieve all user categories.List<CategoryDetail>
getCategories(Collection<Integer> ids)
Retrieve category from its identifierCategoryDetail
getCategory(int id)
Retrieve category from its identifierCategoryDetail
update(CategoryDetail category)
Update a category
-
-
-
Method Detail
-
deleteUserData
public void deleteUserData(String userId) throws SQLException
Deletes all categories created by a user.- Parameters:
userId
- the identifier of the user for which the resources must be deleted.- Throws:
SQLException
- on SQL problem
-
getAllCategoriesByUser
public List<CategoryDetail> getAllCategoriesByUser(String userId) throws SQLException
Retrieve all user categories.- Parameters:
userId
- the user identifier- Returns:
- categories of user links
- Throws:
SQLException
- on SQL problem
-
getCategory
public CategoryDetail getCategory(int id) throws SQLException
Retrieve category from its identifier- Parameters:
id
- the category identifier- Returns:
- the category detail
- Throws:
SQLException
- on SQL problem
-
getCategories
public List<CategoryDetail> getCategories(Collection<Integer> ids) throws SQLException
Retrieve category from its identifier- Parameters:
ids
- the category identifiers- Returns:
- the category detail
- Throws:
SQLException
- on SQL problem
-
create
public CategoryDetail create(CategoryDetail category) throws SQLException
Create new category- Parameters:
category
- category detail to create- Returns:
- new category instance
- Throws:
SQLException
- on SQL problem
-
update
public CategoryDetail update(CategoryDetail category) throws SQLException
Update a category- Parameters:
category
- category detail to update- Returns:
- updated category instance
- Throws:
SQLException
- on SQL problem
-
deleteCategory
public void deleteCategory(int id) throws SQLException
Remove a category- Parameters:
id
- the category identifier to remove- Throws:
SQLException
- on SQL problem
-
-