コード例 #1
0
 @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);
 }
コード例 #2
0
 @Override
 public Itemclass get(Long id) {
   Titemclass t = itemclassDao.get(Titemclass.class, id);
   Itemclass r = new Itemclass();
   BeanUtils.copyProperties(t, r);
   return r;
 }
コード例 #3
0
 @Override
 public List<Itemclass> dataGrid(Itemclass bc, PageFilter ph) {
   List<Itemclass> list = new ArrayList<Itemclass>();
   Map<String, Object> params = new HashMap<String, Object>();
   String hql = " from Titemclass t ";
   List<Titemclass> l =
       itemclassDao.find(
           hql + whereHql(bc, params) + orderHql(ph), params, ph.getPage(), ph.getRows());
   for (Titemclass t : l) {
     Itemclass b = new Itemclass();
     BeanUtils.copyProperties(t, b);
     list.add(b);
   }
   return list;
 }
コード例 #4
0
 @Override
 public Long count(Itemclass bc, PageFilter ph) {
   Map<String, Object> params = new HashMap<String, Object>();
   String hql = " from Titemclass t ";
   return itemclassDao.count("select count(*) " + hql + whereHql(bc, params), params);
 }
コード例 #5
0
 @Override
 public void delete(Long id) {
   Titemclass t = itemclassDao.get(Titemclass.class, id);
   itemclassDao.delete(t);
 }
コード例 #6
0
 @Override
 public void add(Itemclass ic) {
   Titemclass t = new Titemclass();
   BeanUtils.copyProperties(ic, t);
   itemclassDao.save(t);
 }