Package javax.persistence.criteria

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


        CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
        Root<Member> member = criteria.from(Member.class);
        // Swap criteria statements if you would like to try out type-safe criteria queries, a new
        // feature in JPA 2.0
        // criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));
        criteria.select(member).orderBy(cb.asc(member.get("name")));
        return em.createQuery(criteria).getResultList();
    }
}
View Full Code Here


        CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
        Root<Member> member = criteria.from(Member.class);
        // Swap criteria statements if you would like to try out type-safe criteria queries, a new
        // feature in JPA 2.0
        // criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));
        criteria.select(member).orderBy(cb.asc(member.get("name")));
        return em.createQuery(criteria).getResultList();
    }
}
View Full Code Here

      CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
      Root<Member> member = criteria.from(Member.class);
      // Swap criteria statements if you would like to try out type-safe criteria queries, a new
      // feature in JPA 2.0
      // criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));
      criteria.select(member).orderBy(cb.asc(member.get("name")));
      return em.createQuery(criteria).getResultList();
   }
}
View Full Code Here

        CriteriaQuery<ClusterGroup> criteriaQuery = criteriaBuilder.createQuery(ClusterGroup.class);
        Root<ClusterGroup> root = criteriaQuery.from(ClusterGroup.class);

        // CHECKSTYLE-OFF: NestedMethodCall
        criteriaQuery.orderBy(
            criteriaBuilder.asc(root.get(ClusterGroup_.name))
        );
        // CHECKSTYLE-ON: NestedMethodCall

        TypedQuery<ClusterGroup> typedQuery = entityManager.createQuery(criteriaQuery);
        if (Extraction.isRequired(extraction)) {
View Full Code Here

        Root<ScheduleGroup> root = criteriaQuery.from(ScheduleGroup.class);
        root.fetch(ScheduleGroup_.jobs, JoinType.LEFT);

        // CHECKSTYLE-OFF: NestedMethodCall
        criteriaQuery.orderBy(
            criteriaBuilder.asc(root.get(ScheduleGroup_.name))
        );
        // CHECKSTYLE-ON: NestedMethodCall

        TypedQuery<ScheduleGroup> typedQuery = entityManager.createQuery(criteriaQuery);
        if (Extraction.isRequired(extraction)) {
View Full Code Here

            switch (constraint.getColumnSort())
            {

                case ASCENDING:

                    criteria.orderBy(builder.asc(propertyPath));
                    break;

                case DESCENDING:
                    criteria.orderBy(builder.desc(propertyPath));
                    break;
View Full Code Here

            switch (constraint.getColumnSort())
            {

                case ASCENDING:

                    criteria.orderBy(builder.asc(propertyPath));
                    break;

                case DESCENDING:
                    criteria.orderBy(builder.desc(propertyPath));
                    break;
View Full Code Here

        CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
        Root<Member> member = criteria.from(Member.class);
        // Swap criteria statements if you would like to try out type-safe criteria queries, a new
        // feature in JPA 2.0
        // criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));
        criteria.select(member).orderBy(cb.asc(member.get("name")));
        return em.createQuery(criteria).getResultList();
    }
}
View Full Code Here

          criteriaBuilder.and(
            criteriaBuilder.equal(root.get("dataTransacao").as(Date.class),date ),
            criteriaBuilder.equal(root.get("conta"),conta)
          )
        ).orderBy(
            criteriaBuilder.asc(root.get("dataTransacao").as(Date.class))
          );
   
   
    return entityManager
        .createQuery(criteriaQuery)
View Full Code Here

          criteriaBuilder.and(
              criteriaBuilder.between(root.get("dataTransacao").as(Date.class), dataInicial, dataFinal),
              criteriaBuilder.equal(root.get("conta"),conta)
            )
        ).orderBy(
            criteriaBuilder.asc(root.get("dataTransacao").as(Date.class))
          );
   
    return entityManager
        .createQuery(criteriaQuery)
        .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.