private List<Auth> changeModel(List<Tauth> tauths) { List<Auth> l = new ArrayList<Auth>(); if (tauths != null && tauths.size() > 0) { for (Tauth t : tauths) { Auth a = new Auth(); BeanUtils.copyProperties(t, a); if (t.getTauth() != null) { a.setPid(t.getTauth().getCid()); a.setPname(t.getTauth().getCname()); } if (countChildren(t.getCid()) > 0) { a.setState("closed"); } l.add(a); } } return l; }