Package javax.persistence.criteria

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


        Root<User> c = cq.from(User.class);
        Predicate condition = cb.equal(c.get("deleted"), false);
        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);
View Full Code Here


        Predicate predicate = cb.like(path, literal);
        Predicate condition = cb.notEqual(c.get("deleted"), true);
        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);
View Full Code Here

      Root<Room> c = cq.from(Room.class);
      Predicate condition = cb.equal(c.get("deleted"), false);
      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);
View Full Code Here

      Root<Organisation> c = cq.from(Organisation.class);
      Predicate condition = cb.equal(c.get("deleted"), false);
      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);
View Full Code Here

      Predicate subCondition = cb.equal(c.get("externalRoomType"),
          externalRoomType);
      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);
View Full Code Here

      Root<Room> c = cq.from(Room.class);
      Predicate condition = cb.equal(c.get("deleted"), false);
      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);
View Full Code Here

      Predicate subCondition = cb.equal(c.get("externalRoomType"),
          externalRoomType);
      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);
View Full Code Here

        Root<User> c = cq.from(User.class);
        Predicate condition = cb.equal(c.get("deleted"), false);
        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);
View Full Code Here

      Root<Room> c = cq.from(Room.class);
      Predicate condition = cb.equal(c.get("deleted"), false);
      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);
View Full Code Here

            {
                criteriaQuery.where((value != null) ? criteriaBuilder.equal(beanRoot.get(name), value) : criteriaBuilder.isNull(beanRoot.get(name)));
            }
            if (orderBy != null)
            {
                criteriaQuery.orderBy(ascending ? criteriaBuilder.asc(beanRoot.get(orderBy)) : criteriaBuilder.desc(beanRoot.get(orderBy)));
            }
           
            // invoke query
            Query query = entityManager.createQuery(criteriaQuery);
            List<? extends IBean> beansList = query.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.