Package javax.persistence.criteria

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


        final CriteriaQuery<Tuple> cbQuery = cb.createQuery(Tuple.class);

        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));
        }
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.