Package org.silverpeas.core.mylinks.dao
Class LinkDAO
- java.lang.Object
-
- org.silverpeas.core.mylinks.dao.LinkDAO
-
@Repository public class LinkDAO extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LinkDAO()
Hide constructor of utility class
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkDetail
createLink(LinkDetail link)
Create new linkvoid
deleteComponentInstanceData(String componentInstanceId)
Deletes all links about the component instance represented by the given identifier.void
deleteLink(String linkId)
Remove a linkvoid
deleteUserData(String userId)
Delete allprotected static LinkDAO
get()
List<LinkDetail>
getAllLinksByInstance(String instanceId)
Retrieve all links about a component instance id.List<LinkDetail>
getAllLinksByObject(String instanceId, String objectId)
Retrieve all links about an object id on a component instance idList<LinkDetail>
getAllLinksByUser(String userId)
Retrieve user linksLinkDetail
getLink(int linkId)
Retrieve link from identifierprotected List<Integer>
getLinkIdsByComponentInstance(String componentInstanceId)
Gets all the link identifier which references the identifier of a component instance (url, instanceId, etc.).LinkDetail
updateLink(LinkDetail link)
Update a link
-
-
-
Method Detail
-
get
protected static LinkDAO get()
-
deleteComponentInstanceData
public 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
-
getLinkIdsByComponentInstance
protected List<Integer> getLinkIdsByComponentInstance(String componentInstanceId) throws SQLException
Gets all the link identifier which references the identifier of a component instance (url, instanceId, etc.).It is not the same behavior as
getAllLinksByInstance(String)
method which is searching for data only against instanceId field.- Parameters:
componentInstanceId
- the identifier of the component instance for which the resources must be deleted.- Throws:
SQLException
- on SQL problem
-
deleteUserData
public void deleteUserData(String userId) throws SQLException
Delete all- Parameters:
userId
- the identifier of the user for which the resources must be deleted- Throws:
SQLException
- on SQL problem
-
getAllLinksByUser
public List<LinkDetail> getAllLinksByUser(String userId) throws SQLException
Retrieve user links- Parameters:
userId
- the user identifier- Returns:
- list of user links
- Throws:
SQLException
- on SQL problem
-
getAllLinksByInstance
public List<LinkDetail> getAllLinksByInstance(String instanceId) throws SQLException
Retrieve all links about a component instance id.- Parameters:
instanceId
- the component instance identifier- Returns:
- list of LinkDetail
- Throws:
SQLException
- on SQL problem
-
getAllLinksByObject
public List<LinkDetail> getAllLinksByObject(String instanceId, String objectId) throws SQLException
Retrieve all links about an object id on a component instance id- Parameters:
instanceId
- the component instance identifier which hosts the objectobjectId
- the identifier of the object- Returns:
- list of LinkDetail
- Throws:
SQLException
- on SQL problem
-
getLink
public LinkDetail getLink(int linkId) throws SQLException
Retrieve link from identifier- Parameters:
linkId
- the link identifier- Returns:
- the link detail
- Throws:
SQLException
- on SQL problem
-
createLink
public LinkDetail createLink(LinkDetail link) throws SQLException
Create new link- Parameters:
link
- link detail to create- Returns:
- new link instance
- Throws:
SQLException
- on SQL problem
-
updateLink
public LinkDetail updateLink(LinkDetail link) throws SQLException
Update a link- Parameters:
link
- link detail to update- Returns:
- updated link instance
- Throws:
SQLException
- on SQL problem
-
deleteLink
public void deleteLink(String linkId) throws SQLException
Remove a link- Parameters:
linkId
- the link identifier to remove- Throws:
SQLException
- on SQL problem
-
-