public Forum createForum(Forum forum) {

    // TODO: 檢查討論區名稱是否已經存在

    UUID uuid = UUID.randomUUID();
    forum.setUuid(String.valueOf(uuid));
    forum.setCreateTime(new Timestamp((new Date()).getTime()));

    Forum createdForum = forumDao.create(forum);
    return createdForum;
  }
  public List<Object[]> queryForumList(String projectUuid) {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("projectUuid", projectUuid);

    // 查詢結果欄位順序
    // 0: uuid
    // 1: projectUuid
    // 2: title
    // 3: summary
    // 4: status
    @SuppressWarnings("unchecked")
    List<Object[]> resultSet =
        (List<Object[]>) forumDao.queryByNamedQuery("ForumManagement.queryForumList", params);

    return resultSet;
  }
 public Forum queryForum(String uuid) {
   return forumDao.query(new Forum(), uuid);
 }