public void delete(String ids) { if (ids != null) { for (String id : ids.split(",")) { NoteEntity t = noteEntityDao.get(NoteEntity.class, id); if (t != null) { noteEntityDao.delete(t); } } } }
public List<NoteEntity> listAll(NotePage notePage) { String hql = "from NoteEntity where 1 = 1 "; List<Object> values = new ArrayList<Object>(); hql = addWhere(notePage, hql, values); List<NoteEntity> list = noteEntityDao.find(hql, values); return list; }
public void add(NotePage notePage) { if (notePage.getObid() == null || notePage.getObid().trim().equals("")) { notePage.setObid(UUID.randomUUID().toString()); } NoteEntity t = new NoteEntity(); BeanUtils.copyProperties(notePage, t); noteEntityDao.save(t); }
private List<NoteEntity> find(NotePage notePage) { String hql = "from NoteEntity t where 1=1 "; List<Object> values = new ArrayList<Object>(); hql = addWhere(notePage, hql, values); if (notePage.getSort() != null && notePage.getOrder() != null) { hql += " order by " + notePage.getSort() + " " + notePage.getOrder(); } return noteEntityDao.find(hql, notePage.getPage(), notePage.getRows(), values); }
private Long total(NotePage notePage) { String hql = "select count(*) from NoteEntity t where 1=1 "; List<Object> values = new ArrayList<Object>(); hql = addWhere(notePage, hql, values); return noteEntityDao.count(hql, values); }
public NoteEntity get(String obid) { return noteEntityDao.get(NoteEntity.class, obid); }
public NoteEntity get(NotePage notePage) { return noteEntityDao.get(NoteEntity.class, notePage.getObid()); }
public void update(NotePage notePage) throws Exception { NoteEntity t = noteEntityDao.get(NoteEntity.class, notePage.getObid()); if (t != null) { MyBeanUtils.copyBeanNotNull2Bean(notePage, t); } }