コード例 #1
0
 /**
  * Method getLikeCommentByUserComment.
  *
  * @param userId int
  * @param commentId int
  * @return LikeComment
  * @see es.udc.fi.dc.photoalbum.spring.LikeService#getLikeCommentByUserComment(int, int)
  */
 @Override
 public LikeComment getLikeCommentByUserComment(int userId, int commentId) {
   for (LikeComment aux : likeCommentDao.getLikeCommentByComment(commentId)) {
     if (aux.getLike().getUser().getId() == userId) {
       return aux;
     }
   }
   return null;
 }
コード例 #2
0
 /**
  * Method getLikesComment.
  *
  * @param commentId int
  * @param megusta int
  * @return List<LikeComment>
  * @see es.udc.fi.dc.photoalbum.spring.LikeService#getLikesComment(int, int)
  */
 @Override
 public List<LikeComment> getLikesComment(int commentId, int megusta) {
   List<LikeComment> likecomments = likeCommentDao.getLikeCommentByComment(commentId);
   List<LikeComment> likes = new ArrayList<LikeComment>();
   for (LikeComment lc : likecomments) {
     if (lc.getLike().getMegusta() == megusta) {
       likes.add(lc);
     }
   }
   return likes;
 }
コード例 #3
0
 /**
  * Method delete.
  *
  * @param like LikeComment
  * @see es.udc.fi.dc.photoalbum.spring.LikeService#delete(LikeComment)
  */
 @Override
 public void delete(LikeComment like) {
   Likefield l = like.getLike();
   likeCommentDao.delete(like);
   likeDao.delete(l);
 }
コード例 #4
0
 /**
  * Method getLikeCommentByCommentId.
  *
  * @param commentId int
  * @return List<LikeComment>
  * @see es.udc.fi.dc.photoalbum.spring.LikeService#getLikeCommentByCommentId(int)
  */
 @Override
 public List<LikeComment> getLikeCommentByCommentId(int commentId) {
   return likeCommentDao.getLikeCommentByComment(commentId);
 }
コード例 #5
0
 /**
  * Method create.
  *
  * @param likeComment LikeComment
  * @see es.udc.fi.dc.photoalbum.spring.LikeService#create(LikeComment)
  */
 @Override
 public void create(LikeComment likeComment) {
   likeDao.create(likeComment.getLike());
   likeCommentDao.create(likeComment);
 }