Package org.silverpeas.core.mylinks.dao
Class LinkCategoryDAO
- java.lang.Object
-
- org.silverpeas.core.mylinks.dao.LinkCategoryDAO
-
@Repository public class LinkCategoryDAO extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LinkCategoryDAO()
Hide constructor of utility class
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteByCategory(int catId)
Remove couples of link / category.protected void
deleteByLink(int linkId)
Remove couples of link / category.protected void
deleteComponentInstanceData(String componentInstanceId)
Deletes all links about the component instance represented by the given identifier.protected void
deleteUserData(String userId)
Deletes all couples of link / category of a user.protected static LinkCategoryDAO
get()
protected Map<Integer,CategoryDetail>
getAllCategoriesByLink(int linkId)
Retrieve all couple of link / category of given link.protected Map<Integer,CategoryDetail>
getAllCategoriesByLinkOfUser(String userId)
Retrieve all couple of link / category of given user.protected void
saveByLink(LinkDetail link)
Save a couple of link / category.
-
-
-
Method Detail
-
get
protected static LinkCategoryDAO get()
-
deleteComponentInstanceData
protected void deleteComponentInstanceData(String componentInstanceId) throws SQLException
Deletes all links about the component instance represented by the given identifier.- Parameters:
componentInstanceId
- the identifier of the component instance for which the resources must be deleted.- Throws:
SQLException
- on SQL problem
-
deleteUserData
protected void deleteUserData(String userId) throws SQLException
Deletes all couples of link / category of a user.- Parameters:
userId
- the identifier of the user for which data must be deleted.- Throws:
SQLException
- on SQL problem
-
getAllCategoriesByLinkOfUser
protected Map<Integer,CategoryDetail> getAllCategoriesByLinkOfUser(String userId) throws SQLException
Retrieve all couple of link / category of given user.- Parameters:
userId
- the user identifier.- Returns:
- couples of link / category indexed by link id.
- Throws:
SQLException
- on SQL problem
-
getAllCategoriesByLink
protected Map<Integer,CategoryDetail> getAllCategoriesByLink(int linkId) throws SQLException
Retrieve all couple of link / category of given link.- Parameters:
linkId
- the link identifier- Returns:
- couples of link / category
- Throws:
SQLException
- on SQL problem
-
saveByLink
protected void saveByLink(LinkDetail link) throws SQLException
Save a couple of link / category.If
LinkDetail.getCategory()
returns null value, then the deletion is also handled.- Parameters:
link
- link a link.- Throws:
SQLException
- on SQL problem.
-
deleteByLink
protected void deleteByLink(int linkId) throws SQLException
Remove couples of link / category.- Parameters:
linkId
- the link identifier from which to remove couples.- Throws:
SQLException
- on SQL problem
-
deleteByCategory
protected void deleteByCategory(int catId) throws SQLException
Remove couples of link / category.- Parameters:
catId
- the identifier of the category to remove from couples.- Throws:
SQLException
- on SQL problem
-
-