@Override public Long count(Map filterMap) { String query = "select count(*) from " + persistentClass.getSimpleName() + " where 1=1"; List filterList = new ArrayList(); query += getFilterQuery(filterList, filterMap); return (Long) daoHelper.findFirst(query, filterList.toArray()); }
@Override public List<E> search(String query, Object... args) { // Object ob = perfMonitor.startDaoWatch(query); List ls = (List<E>) daoHelper.find(0, 50, query, args); // perfMonitor.stopDaoWatch(ob); return ls; }
@Override public List<E> list( int pageIdx, int pageSize, Map filterMap, String sortColumn, SortOrder sortOrder) { String query = "from " + persistentClass.getSimpleName() + " where 1=1"; List filterList = new ArrayList(); query += getFilterQuery(filterList, filterMap); if (StringUtils.isNotEmpty(sortColumn)) { query += " order by " + sortColumn; if (sortOrder != null) { query += " " + sortOrder.toString(); } } return (List<E>) daoHelper.find(pageIdx, pageSize, query, filterList.toArray()); }
@Override public void delete(E entity) { if (entity instanceof BaseEntity) { daoHelper.delete(entity); } }
public E update(E entity) { return daoHelper.update(entity); }
public E save(E entity) { return daoHelper.save(entity); }
// --------- IDao Interface --------- // @Override public E get(Long id) { // TODO Auto-generated method stub return daoHelper.get(persistentClass, id); }