Package javax.persistence.criteria

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


      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);
      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, 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<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<User> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<User> 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<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

            {
                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

                }
                criteriaQuery.where(predicate);
            }
            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.