/*添加评论*/ public void addComment(Comment comment, Video video) { commentDao.save(comment); video.setCommentCount(video.getCommentCount() + 1); videoDao.update(video); }
/*获取视频的评论*/ public List<Comment> findComment(Video video) { Object[] params = new Object[] {video}; Map<String, String> orderBy = new LinkedHashMap<String, String>(); orderBy.put("o.time", Const.ODER_DESC); return commentDao.findByCondition("and o.video=?", params, orderBy, false); }