Package javax.persistence.criteria

Examples of javax.persistence.criteria.CriteriaBuilder.desc()


            query.select(from);

            Predicate predicate1 = criteriaBuilder.equal(from.get("oid"), oid);
            Predicate predicate2 = criteriaBuilder.le(from.get("timestamp"), timestamp);
            query.where(criteriaBuilder.and(predicate1, predicate2));
            query.orderBy(criteriaBuilder.desc(from.get("timestamp")));

            TypedQuery<JPAObject> typedQuery = entityManager.createQuery(query).setMaxResults(1);
            List<JPAObject> resultList = typedQuery.getResultList();

            if (resultList.size() < 1) {
View Full Code Here


        cq.where(condition);
        cq.distinct(asc);
        if (asc) {
          cq.orderBy(cb.asc(c.get(orderby)));
        } else {
          cq.orderBy(cb.desc(c.get(orderby)));
        }
        TypedQuery<User> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<User> ll = q.getResultList();
View Full Code Here

        cq.where(condition, predicate);
        cq.distinct(asc);
        if (asc) {
          cq.orderBy(cb.asc(c.get(orderby)));
        } else {
          cq.orderBy(cb.desc(c.get(orderby)));
        }
        TypedQuery<User> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<User> contactsZ = q.getResultList();
View Full Code Here

      cq.where(condition);
      cq.distinct(asc);
      if (asc) {
        cq.orderBy(cb.asc(c.get(orderby)));
      } else {
        cq.orderBy(cb.desc(c.get(orderby)));
      }
      TypedQuery<Room> q = em.createQuery(cq);
      q.setFirstResult(start);
      q.setMaxResults(max);
      List<Room> ll = q.getResultList();
View Full Code Here

      cq.where(condition, subCondition);
      cq.distinct(asc);
      if (asc) {
        cq.orderBy(cb.asc(c.get(orderby)));
      } else {
        cq.orderBy(cb.desc(c.get(orderby)));
      }
      TypedQuery<Room> q = em.createQuery(cq);
      q.setFirstResult(start);
      q.setMaxResults(max);
      List<Room> ll = q.getResultList();
View Full Code Here

      cq.where(condition);
      cq.distinct(asc);
      if (asc) {
        cq.orderBy(cb.asc(c.get(orderby)));
      } else {
        cq.orderBy(cb.desc(c.get(orderby)));
      }
      TypedQuery<Organisation> q = em.createQuery(cq);
      q.setFirstResult(start);
      q.setMaxResults(max);
      List<Organisation> ll = q.getResultList();
View Full Code Here

        cq.where(condition);
        cq.distinct(asc);
        if (asc) {
          cq.orderBy(cb.asc(c.get(orderby)));
        } else {
          cq.orderBy(cb.desc(c.get(orderby)));
        }
        TypedQuery<Users> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<Users> ll = q.getResultList();
View Full Code Here

        cq.where(condition, predicate);
        cq.distinct(asc);
        if (asc) {
          cq.orderBy(cb.asc(c.get(orderby)));
        } else {
          cq.orderBy(cb.desc(c.get(orderby)));
        }
        TypedQuery<Users> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<Users> contactsZ = q.getResultList();
View Full Code Here

      cq.where(condition);
      cq.distinct(asc);
      if (asc) {
        cq.orderBy(cb.asc(c.get(orderby)));
      } else {
        cq.orderBy(cb.desc(c.get(orderby)));
      }
      TypedQuery<Rooms> q = em.createQuery(cq);
      q.setFirstResult(start);
      q.setMaxResults(max);
      List<Rooms> ll = q.getResultList();
View Full Code Here

      cq.where(condition, subCondition);
      cq.distinct(asc);
      if (asc) {
        cq.orderBy(cb.asc(c.get(orderby)));
      } else {
        cq.orderBy(cb.desc(c.get(orderby)));
      }
      TypedQuery<Rooms> q = em.createQuery(cq);
      q.setFirstResult(start);
      q.setMaxResults(max);
      List<Rooms> ll = q.getResultList();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.