Examples of lessThanOrEqualTo()


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

    ParameterExpression<String> p = cb.parameter(String.class);
    if (!(category == null || category.equals(ALL_CATEGORY))) {
      //cb.equal(imageContent.get("category"), p);
    }
    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);
View Full Code Here

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

    if (query.getUpdateDateFrom() != null) {
      predicates.add(cb.greaterThanOrEqualTo(evsr.get(EventSource_.updateDate),
          query.getUpdateDateFrom()));
    }
    if (query.getUpdateDateTo() != null) {
      predicates.add(cb.lessThanOrEqualTo(evsr.get(EventSource_.updateDate),
          query.getUpdateDateTo()));
    }
    if (predicates.size() > 0) {
      cq.where(predicates.toArray(new Predicate[predicates.size()]));
    }
View Full Code Here

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

        final Root<SearchRequest> requestRoot = cbQuery.from(SearchRequest.class);

        final Path<ISODate> requestDate = requestRoot.get(SearchRequest_.requestDate);
        final Expression<String> requestDateByType = cb.substring(requestDate.get(ISODate_.dateAndTime), 1, dateInterval.getSubstringEnd());

        Predicate whereClause = cb.and(cb.lessThanOrEqualTo(requestDate, to), cb.greaterThanOrEqualTo(requestDate, from));
        if (spec != null) {
            whereClause = cb.and(whereClause, spec.toPredicate(requestRoot, cbQuery, cb));
        }
        final CompoundSelection<Tuple> selection = cb.tuple(requestDateByType, cb.count(requestRoot));
        cbQuery.select(selection)
View Full Code Here

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

          } else if (t == Filter.NOT_EQUAL) {
            predicates.add(builder.notEqual(datePath, dateVal));
          } else if (t == Filter.LESS_THAN) {
            predicates.add(builder.lessThan(datePath, dateVal));
          } else if (t == Filter.LESS_THAN_EQUAL) {
            predicates.add(builder.lessThanOrEqualTo(datePath, dateVal));
          } else if (t == Filter.GREATER_THAN) {
            predicates.add(builder.greaterThan(datePath, dateVal));
          } else if (t == Filter.GREATER_THAN_EQUAL) {
            predicates.add(builder.greaterThanOrEqualTo(datePath, dateVal));
          }
View Full Code Here

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

          } else if (t == Filter.NOT_EQUAL) {
            predicates.add(builder.notEqual(datePath, dateVal));
          } else if (t == Filter.LESS_THAN) {
            predicates.add(builder.lessThan(datePath, dateVal));
          } else if (t == Filter.LESS_THAN_EQUAL) {
            predicates.add(builder.lessThanOrEqualTo(datePath, dateVal));
          } else if (t == Filter.GREATER_THAN) {
            predicates.add(builder.greaterThan(datePath, dateVal));
          } else if (t == Filter.GREATER_THAN_EQUAL) {
            predicates.add(builder.greaterThanOrEqualTo(datePath, dateVal));
          }
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.