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);