Package com.iisigroup.cap.dao.utils

Examples of com.iisigroup.cap.dao.utils.ISearch


        return find(search);
    }

    @Override
    public List<Department> findByAllActDepartment() {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.NOT_EQUALS, "status", "Y");
        search.setFirstResult(0).setMaxResults(Integer.MAX_VALUE);
        search.addOrderBy("code");
        return find(search);
    }
View Full Code Here


        return find(search);
    }

    @Override
    public Department findByCode(String code) {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.EQUALS, "code", code);
        return findUniqueOrNone(search);
    }
View Full Code Here

    private static final int NO_PARENT = -1;

    @Override
    public List<Function> findAll(String system) {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.EQUALS, "sysType", system);
        search.addSearchModeParameters(SearchMode.EQUALS, "status", "1"); // 啟用
        search.addOrderBy("level");
        search.addOrderBy("parent");
        search.addOrderBy("sequence");
        return find(search);
    }
View Full Code Here

        return find(search);
    }

    @Override
    public List<Function> findBySysTypeAndLevel(String sysType, String level) {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.EQUALS, "sysType", sysType);
        search.addSearchModeParameters(SearchMode.EQUALS, "level", level);
        return find(search);
    }// ;
View Full Code Here

                new FunctionRowMapper());
    }

    @Override
    public Function findByCode(int code) {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.EQUALS, "code", code);
        return findUniqueOrNone(search);
    }// ;
View Full Code Here

    }
    return null;
  }// ;

  public Iterator<T> list(int first, int count) {
    ISearch search = createSearchTemplete();
    search.setFirstResult(first).setMaxResults(count);
    return createQuery(getType(), search).getResultList().iterator();
  }// ;
View Full Code Here

    return new Page<S>(find(clazz, search), count(clazz, search),
        search.getMaxResults(), search.getFirstResult());
  }// ;

  protected <S> TypedQuery<S> createQuery(Class<S> clazz, ISearch search) {
    ISearch thisSearch = (search != null) ? search : createSearchTemplete();
    CriteriaBuilder builder = getEntityManager().getCriteriaBuilder();
    CriteriaQuery<S> query = builder.createQuery(clazz);
    Root<S> root = query.from(clazz);

    query = applySpecificationToCriteria(root, query, builder, thisSearch);
View Full Code Here

        builder, thisSearch);
    return tquery;
  }// ;

  protected TypedQuery<T> createQuery(ISearch search) {
    ISearch thisSearch = (search != null) ? search : createSearchTemplete();
    CriteriaBuilder builder = getEntityManager().getCriteriaBuilder();
    CriteriaQuery<T> query = builder.createQuery(getType());
    Root<T> root = query.from(getType());

    query = applySpecificationToCriteria(root, query, builder, thisSearch);
View Full Code Here

        return (List<Role>) query.getResultList();
    }

    @Override
    public List<Role> findAll() {
        ISearch search = createSearchTemplete();
        search.setFirstResult(0).setMaxResults(Integer.MAX_VALUE);
        search.addOrderBy("code");
        List<Role> list = find(search);
        return list;
    }
View Full Code Here

        return list;
    }

    @Override
    public Role findByCode(String code) {
        ISearch search = createSearchTemplete();
        search.addSearchModeParameters(SearchMode.EQUALS, "code", code);
        return findUniqueOrNone(search);
    }// ;
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.dao.utils.ISearch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.