Package javax.persistence.criteria

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


               
                //Build the and(eq, like) predicate and add it to the list of predicates for the where clause
                whereParts.add(
                    cb.and(
                        cb.equal(attributes.get(LocalAccountPersonAttributeImpl_.name), nameParam),
                        cb.like(cb.lower(attributeValues.as(String.class)), valueParam)
                    )
                );
               
                paramCount++;
            }
View Full Code Here

          /*
           * If we're not doing a case sensitive filter, normalize both
           * the path and the value we're comparing
           */
          if (!filter.getCaseSensitive()) {
            path = builder.lower((Expression<String>) path);
            val = stringVal.toLowerCase()
          }
         
          /*
           * If we've got an "or" get the parts
View Full Code Here

          /*
           * If we're not doing a case sensitive filter, normalize both
           * the path and the value we're comparing
           */
          if (!filter.getCaseSensitive()) {
            path = builder.lower((Expression<String>) path);
            val = String.valueOf(val).toLowerCase()
          }
         
          /*
           * If exactMatch = true, we need to check for absolute equality
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.