Package com.jms.socialmedia.mybatis
Class SqlSessionCommentsMapper
- java.lang.Object
-
- com.jms.socialmedia.mybatis.SqlSessionCommentsMapper
-
- All Implemented Interfaces:
CommentsMapper
public class SqlSessionCommentsMapper extends Object implements CommentsMapper
-
-
Constructor Summary
Constructors Constructor Description SqlSessionCommentsMapper(org.apache.ibatis.session.SqlSessionFactory sessionfactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addComment(Comment comment)
int
deleteComment(int commentId)
int
editComment(int commentId, String commentText)
Comment
getComment(int commentId)
Collection<Integer>
getCommentLikes(int commentId)
Collection<Comment>
getComments(int postId)
Collection<Comment>
getCommentsByUserId(int userId)
int
getNumberOfCommentsInPost(int postId)
Integer
getUserIdFromCommentId(int commentId)
int
likeComment(int commentId, int userId)
int
unlikeComment(int commentId, int userId)
-
-
-
Method Detail
-
getNumberOfCommentsInPost
public int getNumberOfCommentsInPost(int postId)
- Specified by:
getNumberOfCommentsInPost
in interfaceCommentsMapper
-
getComments
public Collection<Comment> getComments(int postId)
- Specified by:
getComments
in interfaceCommentsMapper
-
getCommentsByUserId
public Collection<Comment> getCommentsByUserId(int userId)
- Specified by:
getCommentsByUserId
in interfaceCommentsMapper
-
getComment
public Comment getComment(int commentId)
- Specified by:
getComment
in interfaceCommentsMapper
-
getUserIdFromCommentId
public Integer getUserIdFromCommentId(int commentId)
- Specified by:
getUserIdFromCommentId
in interfaceCommentsMapper
-
addComment
public int addComment(Comment comment)
- Specified by:
addComment
in interfaceCommentsMapper
-
editComment
public int editComment(int commentId, String commentText)
- Specified by:
editComment
in interfaceCommentsMapper
-
deleteComment
public int deleteComment(int commentId)
- Specified by:
deleteComment
in interfaceCommentsMapper
-
getCommentLikes
public Collection<Integer> getCommentLikes(int commentId)
- Specified by:
getCommentLikes
in interfaceCommentsMapper
-
likeComment
public int likeComment(int commentId, int userId)
- Specified by:
likeComment
in interfaceCommentsMapper
-
unlikeComment
public int unlikeComment(int commentId, int userId)
- Specified by:
unlikeComment
in interfaceCommentsMapper
-
-