@Override public Comment addComment(Comment comment) throws ResourceNotFoundException { Long createdId = commentsDao.save(comment); if (createdId == null) { throw new ResourceNotFoundException(String.format("[Article id=%s", comment.getArticleId())); } comment.setId(createdId); return comment; }
@Override public List<Comment> getComments(long articleId) { return commentsDao.getComments(articleId); }