예제 #1
0
  // 获取某活动的所有评论
  @Override
  public List<Comment> getAllCommentsByAID(long aid) {

    String hql = "from Comment where aid=" + aid + "order by createtime desc";
    try {
      List<Comment> list = (List<Comment>) commentDao.selectHql(hql);
      if (list != null && list.size() != 0) {
        return list;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return null;
  }
예제 #2
0
 // 获取某活动所有评论个数
 @Override
 public int getAllCommentNumberByAID(long aid) {
   String hql = "from Comment where aid=" + aid;
   List<Comment> list = (List<Comment>) commentDao.selectHql(hql);
   return list.size();
 }