@Override
 public void edit(Itemclass r) {
   Titemclass t = itemclassDao.get(Titemclass.class, r.getId());
   t.setName(r.getName());
   t.setCode(r.getCode());
   itemclassDao.update(t);
 }
 private String whereHql(Itemclass bc, Map<String, Object> params) {
   String hql = "";
   if (bc != null) {
     hql += " where 1=1 ";
     if (bc.getName() != null) {
       hql += " and t.name like :name";
       params.put("name", "%%" + bc.getName() + "%%");
     }
   }
   return hql;
 }