示例#1
0
 @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());
 }
示例#2
0
 @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;
 }
示例#3
0
  @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());
  }
示例#4
0
 @Override
 public void delete(E entity) {
   if (entity instanceof BaseEntity) {
     daoHelper.delete(entity);
   }
 }
示例#5
0
 public E update(E entity) {
   return daoHelper.update(entity);
 }
示例#6
0
 public E save(E entity) {
   return daoHelper.save(entity);
 }
示例#7
0
 // --------- IDao Interface --------- //
 @Override
 public E get(Long id) {
   // TODO Auto-generated method stub
   return daoHelper.get(persistentClass, id);
 }