Examples of lower()


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

        // We only want results that match the search query
        List<Predicate> restrictions = new ArrayList<Predicate>();
        String lq = query.toLowerCase();
        restrictions.add(
            builder.or(
                builder.like(builder.lower(sku.get("name").as(String.class)), '%' + lq + '%'),
                builder.like(builder.lower(sku.get("longDescription").as(String.class)), '%' + lq + '%')
            )
        );
               
        attachProductSearchCriteria(searchCriteria, product, sku, restrictions);
View Full Code Here

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

        List<Predicate> restrictions = new ArrayList<Predicate>();
        String lq = query.toLowerCase();
        restrictions.add(
            builder.or(
                builder.like(builder.lower(sku.get("name").as(String.class)), '%' + lq + '%'),
                builder.like(builder.lower(sku.get("longDescription").as(String.class)), '%' + lq + '%')
            )
        );
               
        attachProductSearchCriteria(searchCriteria, product, sku, restrictions);
       
View Full Code Here

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

        } else if (fieldName.contains("productAttributes.")) {
            pathToUse = product.join("productAttributes");
           
            fieldName = fieldName.substring("productAttributes.".length());
            criteria.where(builder.equal(
                builder.lower(pathToUse.get("name").as(String.class)), fieldName.toLowerCase()));
           
            fieldName = "value";
        } else if (fieldName.contains("product.")) {
            pathToUse = product;
            fieldName = fieldName.substring("product.".length());
View Full Code Here

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

        CriteriaBuilder builder = em.getCriteriaBuilder();
        CriteriaQuery<Hotel> cquery = builder.createQuery(Hotel.class);
        Root<Hotel> hotel = cquery.from(Hotel.class);
        // QUESTION can like create the pattern for us?
        cquery.select(hotel).where(
                builder.or(builder.like(builder.lower(hotel.get(Hotel_.name)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.city)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.zip)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.address)), criteria.getSearchPattern())));

        List<Hotel> results = em.createQuery(cquery).setMaxResults(criteria.getFetchSize())
View Full Code Here

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

        CriteriaQuery<Hotel> cquery = builder.createQuery(Hotel.class);
        Root<Hotel> hotel = cquery.from(Hotel.class);
        // QUESTION can like create the pattern for us?
        cquery.select(hotel).where(
                builder.or(builder.like(builder.lower(hotel.get(Hotel_.name)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.city)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.zip)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.address)), criteria.getSearchPattern())));

        List<Hotel> results = em.createQuery(cquery).setMaxResults(criteria.getFetchSize())
                .setFirstResult(criteria.getFetchOffset()).getResultList();
View Full Code Here

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

        Root<Hotel> hotel = cquery.from(Hotel.class);
        // QUESTION can like create the pattern for us?
        cquery.select(hotel).where(
                builder.or(builder.like(builder.lower(hotel.get(Hotel_.name)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.city)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.zip)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.address)), criteria.getSearchPattern())));

        List<Hotel> results = em.createQuery(cquery).setMaxResults(criteria.getFetchSize())
                .setFirstResult(criteria.getFetchOffset()).getResultList();
View Full Code Here

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

        // QUESTION can like create the pattern for us?
        cquery.select(hotel).where(
                builder.or(builder.like(builder.lower(hotel.get(Hotel_.name)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.city)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.zip)), criteria.getSearchPattern()),
                        builder.like(builder.lower(hotel.get(Hotel_.address)), criteria.getSearchPattern())));

        List<Hotel> results = em.createQuery(cquery).setMaxResults(criteria.getFetchSize())
                .setFirstResult(criteria.getFetchOffset()).getResultList();

        nextPageAvailable = results.size() > criteria.getPageSize();
View Full Code Here

Examples of org.apache.empire.db.expr.column.DBValueExpr.lower()

     * @return the new DBCompareColExpr object
     */
    public DBCompareColExpr likeLower(String value)
    {
        DBValueExpr expr = new DBValueExpr(getDatabase(), value, DataType.TEXT);
        return new DBCompareColExpr(this.lower(), DBCmpType.LIKE, expr.lower());
    }

    /**
     * Creates and returns a new comparison object for the SQL "like" operator.
     *
 
View Full Code Here

Examples of org.apache.empire.db.expr.column.DBValueExpr.lower()

     * @return the new DBCompareColExpr object
     */
    public DBCompareColExpr likeLower(String value)
    {
        DBValueExpr expr = new DBValueExpr(getDatabase(), value, DataType.TEXT);
        return new DBCompareColExpr(this.lower(), DBCmpType.LIKE, expr.lower());
    }

    /**
     * Creates and returns a new comparison object for the SQL "like" operator.
     *
 
View Full Code Here

Examples of org.apache.empire.db.expr.column.DBValueExpr.lower()

     * @return the new DBCompareColExpr object
     */
    public DBCompareColExpr likeLower(String value)
    {
        DBValueExpr expr = new DBValueExpr(getDatabase(), value, DataType.TEXT);
        return new DBCompareColExpr(this.lower(), DBCmpType.LIKE, expr.lower());
    }

    /**
     * Creates and returns a new comparison object for the SQL "like" operator.
     *
 
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.