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<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; }