Package com.jms.socialmedia.mybatis
Class SqlSessionPostsMapper
- java.lang.Object
-
- com.jms.socialmedia.mybatis.SqlSessionPostsMapper
-
- All Implemented Interfaces:
PostsMapper
public class SqlSessionPostsMapper extends Object implements PostsMapper
-
-
Constructor Summary
Constructors Constructor Description SqlSessionPostsMapper(org.apache.ibatis.session.SqlSessionFactory sessionfactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addPost(Post post)
int
deletePost(int postId)
int
editPost(int postId, String postText)
Collection<Post>
getCommentedPostsByUserId(int userId)
Collection<Post>
getLikedPostsByUserId(int userId)
int
getNumberOfPosts()
Post
getPost(int postId)
Collection<Integer>
getPostLikes(int postId)
Collection<Post>
getPosts(Collection<Integer> userIds, String username, String tag, String onDate, String beforeDate, String afterDate, Integer sincePostId, String sortBy, boolean sortOrderAsc)
Integer
getUserIdFromPostId(int postId)
int
likePost(int postId, int userId)
int
unlikePost(int postId, int userId)
-
-
-
Method Detail
-
getNumberOfPosts
public int getNumberOfPosts()
- Specified by:
getNumberOfPosts
in interfacePostsMapper
-
getPosts
public Collection<Post> getPosts(Collection<Integer> userIds, String username, String tag, String onDate, String beforeDate, String afterDate, Integer sincePostId, String sortBy, boolean sortOrderAsc)
- Specified by:
getPosts
in interfacePostsMapper
-
getPost
public Post getPost(int postId)
- Specified by:
getPost
in interfacePostsMapper
-
getUserIdFromPostId
public Integer getUserIdFromPostId(int postId)
- Specified by:
getUserIdFromPostId
in interfacePostsMapper
-
addPost
public int addPost(Post post)
- Specified by:
addPost
in interfacePostsMapper
-
editPost
public int editPost(int postId, String postText)
- Specified by:
editPost
in interfacePostsMapper
-
deletePost
public int deletePost(int postId)
- Specified by:
deletePost
in interfacePostsMapper
-
getLikedPostsByUserId
public Collection<Post> getLikedPostsByUserId(int userId)
- Specified by:
getLikedPostsByUserId
in interfacePostsMapper
-
getPostLikes
public Collection<Integer> getPostLikes(int postId)
- Specified by:
getPostLikes
in interfacePostsMapper
-
likePost
public int likePost(int postId, int userId)
- Specified by:
likePost
in interfacePostsMapper
-
unlikePost
public int unlikePost(int postId, int userId)
- Specified by:
unlikePost
in interfacePostsMapper
-
getCommentedPostsByUserId
public Collection<Post> getCommentedPostsByUserId(int userId)
- Specified by:
getCommentedPostsByUserId
in interfacePostsMapper
-
-