Examples of desc()


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

        criteriaQuery.where(
            criteriaBuilder.isNull(root.get(ScheduleExecution_.finished))
        );

        criteriaQuery.orderBy(
            criteriaBuilder.desc(root.get(ScheduleExecution_.fired))
        );
        // CHECKSTYLE-ON: NestedMethodCall

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

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

        criteriaQuery.where(
            criteriaBuilder.equal(root.get(ScheduleExecution_.job).get(ScheduleJob_.id), scheduleJobId)
        );

        criteriaQuery.orderBy(
            criteriaBuilder.desc(root.get(ScheduleExecution_.fired))
        );
        // CHECKSTYLE-ON: NestedMethodCall

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

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

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

                case DESCENDING:
                    criteria.orderBy(builder.desc(propertyPath));
                    break;

                default:
            }
        }
View Full Code Here

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

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

                case DESCENDING:
                    criteria.orderBy(builder.desc(propertyPath));
                    break;

                default:
            }
        }
View Full Code Here

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

            {
                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

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

                }
                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

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

    }
    ParameterExpression<Date> pDate = cb.parameter(Date.class);
    cq.where(cb.lessThanOrEqualTo(
        imageContent.<Date> get("createAt"), pDate));
   
    cq.orderBy(cb.desc(imageContent.get("createAt")));

    TypedQuery<ImageContent> query = em.createQuery(cq);
    query.setParameter(p, category);
    query.setParameter(pDate, date);
    query.setFirstResult(first);
View Full Code Here

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

            critQuery.where(wherePredicate);
        }
       
        // order-by-clause
    critQuery.orderBy(Arrays.asList(
        critBuilder.desc(root.get(Invoice_.year)),
        critBuilder.desc(root.get(Invoice_.number))));
       
    TypedQuery<Invoice> query = em.createQuery(critQuery);
   
    query.setFirstResult(filter.calculateFirstResultIndex());
View Full Code Here

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

        }
       
        // order-by-clause
    critQuery.orderBy(Arrays.asList(
        critBuilder.desc(root.get(Invoice_.year)),
        critBuilder.desc(root.get(Invoice_.number))));
       
    TypedQuery<Invoice> query = em.createQuery(critQuery);
   
    query.setFirstResult(filter.calculateFirstResultIndex());
    query.setMaxResults(filter.getPaginatedPageSize());
View Full Code Here

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

    // select-clause
    Root<Invoice> root = critQuery.from(Invoice.class);
    critQuery.select(root)
        .where(critBuilder.equal(root.get(Invoice_.year), year))
        .orderBy(critBuilder.desc(root.get(Invoice_.number)));
   
    TypedQuery<Invoice> query = em.createQuery(critQuery).setMaxResults(1);
   
    Invoice invoice = null;
    try {
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.