Examples of asc()


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

        // }
        SortOrderItem item = iter.next();
        Path<?> path = root.get(mt.getSingularAttribute(item.getProperty()));
        Direction direction = item.getDirection();
        if (direction == Direction.ASC) {
          orderList.add(cb.asc(path));
        } else if (direction == Direction.DESC) {
          orderList.add(cb.desc(path));
        } else if (direction == Direction.ASC_TRUNC) {
          orderList.add(cb.asc(cb.function("trunc", Path.class, path)));
        } else if (direction == Direction.DESC_TRUNC) {
View Full Code Here

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

        if (direction == Direction.ASC) {
          orderList.add(cb.asc(path));
        } else if (direction == Direction.DESC) {
          orderList.add(cb.desc(path));
        } else if (direction == Direction.ASC_TRUNC) {
          orderList.add(cb.asc(cb.function("trunc", Path.class, path)));
        } else if (direction == Direction.DESC_TRUNC) {
          orderList.add(cb.desc(cb.function("trunc", Path.class, path)));
        }
      }
      cq.orderBy(orderList);
View Full Code Here

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

      ArrayList<Order> order = new ArrayList<Order>();
      while (iter.hasNext()) {
        Entry<String, Direction> entry = iter.next();
        Path<?> path = evsr.get(mt.getSingularAttribute(entry.getKey()));
        if (entry.getValue() == Direction.ASC) {
          order.add(cb.asc(path));
        } else if (entry.getValue() == Direction.DESC) {
          order.add(cb.desc(path));
        }
      }
      cq.orderBy(order);
View Full Code Here

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

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

            // Build the Query
            CriteriaBuilder cb = em.getCriteriaBuilder();
            CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
            Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
            cq.where(cb.equal(gradedEventRoot.get("course"), course));
            cq.orderBy(cb.asc(gradedEventRoot.get("assignment")),
                    cb.asc(gradedEventRoot.get("version")));
            TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

            // Run the query and return the resulting list of Graded Events
            return gradedEventQuery.getResultList();
View Full Code Here

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

            CriteriaBuilder cb = em.getCriteriaBuilder();
            CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
            Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
            cq.where(cb.equal(gradedEventRoot.get("course"), course));
            cq.orderBy(cb.asc(gradedEventRoot.get("assignment")),
                    cb.asc(gradedEventRoot.get("version")));
            TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

            // Run the query and return the resulting list of Graded Events
            return gradedEventQuery.getResultList();
        }
View Full Code Here

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

            CriteriaBuilder cb = em.getCriteriaBuilder();
            CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
            Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
            cq.where(cb.and(cb.equal(gradedEventRoot.get("course"), course),
                    cb.equal(gradedEventRoot.get("term"), term)));
            cq.orderBy(cb.asc(gradedEventRoot.get("assignment")),
                    cb.asc(gradedEventRoot.get("version")));
            TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

            // Run the query and return the resulting list of Graded Events
            return gradedEventQuery.getResultList();
View Full Code Here

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

            CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
            Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
            cq.where(cb.and(cb.equal(gradedEventRoot.get("course"), course),
                    cb.equal(gradedEventRoot.get("term"), term)));
            cq.orderBy(cb.asc(gradedEventRoot.get("assignment")),
                    cb.asc(gradedEventRoot.get("version")));
            TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

            // Run the query and return the resulting list of Graded Events
            return gradedEventQuery.getResultList();
        }
View Full Code Here

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

        // Build the Query
        CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
        Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
        cq.orderBy(cb.asc(gradedEventRoot.get("course").get("name")),
                cb.asc(gradedEventRoot.get("assignment")),
                cb.asc(gradedEventRoot.get("version")));
        TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

        // Run the query and return the resulting list of Graded Events
View Full Code Here

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

        // Build the Query
        CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<GradedEvent> cq = cb.createQuery(GradedEvent.class);
        Root<GradedEvent> gradedEventRoot = cq.from(GradedEvent.class);
        cq.orderBy(cb.asc(gradedEventRoot.get("course").get("name")),
                cb.asc(gradedEventRoot.get("assignment")),
                cb.asc(gradedEventRoot.get("version")));
        TypedQuery<GradedEvent> gradedEventQuery = em.createQuery(cq);

        // Run the query and return the resulting list of Graded Events
        return gradedEventQuery.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.