public List<Auth> treegrid(Auth auth) {
   List<Tauth> l;
   if (auth != null && auth.getId() != null) {
     l =
         authDao.find(
             "from Tauth t where t.tauth.cid = ? order by t.cseq", new Object[] {auth.getId()});
   } else {
     l = authDao.find("from Tauth t where t.tauth is null order by t.cseq");
   }
   return changeModel(l);
 }
 public List<User> combobox(User user) {
   String q = "";
   if (user != null && user.getQ() != null) {
     q = user.getQ().trim();
   }
   return changeModel(
       userDao.find(
           "from Tuser t where t.cname like ?", new Object[] {"%%" + q.trim() + "%%"}, 1, 10));
 }
  private List<Tuser> find(User user) {
    String hql = "from Tuser t where 1=1 ";

    List<Object> values = new ArrayList<Object>();
    hql = addWhere(user, hql, values);

    if (user.getSort() != null && user.getOrder() != null) {
      hql += " order by " + user.getSort() + " " + user.getOrder();
    }
    return userDao.find(hql, values, user.getPage(), user.getRows());
  }
 public List<TreeNode> tree(Auth auth, boolean b) {
   List<Object> param = new ArrayList<Object>();
   String hql = "from Tauth t where t.tauth is null order by t.cseq";
   if (auth != null && auth.getId() != null && !auth.getId().trim().equals("")) {
     hql = "from Tauth t where t.tauth.cid = ? order by t.cseq";
     param.add(auth.getId());
   }
   List<Tauth> l = authDao.find(hql, param);
   List<TreeNode> tree = new ArrayList<TreeNode>();
   for (Tauth t : l) {
     tree.add(this.tree(t, b));
   }
   return tree;
 }