List of usage examples for javax.persistence.criteria CriteriaBuilder lower
Expression<String> lower(Expression<String> x);
From source file:edu.pitt.dbmi.ccd.db.specification.GroupSpecification.java
private static Predicate nameContains(Root<Group> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(NAME)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.GroupSpecification.java
private static Predicate descriptionContains(Root<Group> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(DESC)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.VocabularySpecification.java
private static Predicate nameContains(Root<Vocabulary> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(NAME)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.VocabularySpecification.java
private static Predicate descriptionContains(Root<Vocabulary> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(DESC)), term); }
From source file:com.mtt.myapp.user.repository.UserSpecification.java
/** * Create "Email like" query spec./*from w w w. jav a 2 s . c om*/ * @param query query * @return created spec */ public static Specification<User> emailLike(final String query) { return new Specification<User>() { @Override public Predicate toPredicate(Root<User> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) { String pattern = ("%" + query + "%").toLowerCase(); return cb.like(cb.lower(root.get("email").as(String.class)), pattern); } }; }
From source file:com.mtt.myapp.user.repository.UserSpecification.java
/** * Create "Name Like" query spec./*from w w w .j av a 2 s . com*/ * @param query query * @return created spec */ public static Specification<User> nameLike(final String query) { return new Specification<User>() { @Override public Predicate toPredicate(Root<User> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder cb) { String pattern = ("%" + query + "%").toLowerCase(); return cb.or(cb.like(cb.lower(root.get("userName").as(String.class)), pattern), cb.like(cb.lower(root.get("userId").as(String.class)), pattern)); } }; }
From source file:edu.pitt.dbmi.ccd.db.specification.AnnotationTargetSpecification.java
private static Predicate titleContains(Root<AnnotationTarget> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(TITLE)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.AnnotationTargetSpecification.java
private static Predicate addressContains(Root<AnnotationTarget> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(ADDRESS)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.AnnotationTargetSpecification.java
private static Predicate fileNameContains(Root<AnnotationTarget> root, CriteriaBuilder cb, String term) { return cb.like(cb.lower(root.get(FILE).get(NAME)), term); }
From source file:edu.pitt.dbmi.ccd.db.specification.AnnotationTargetSpecification.java
private static Predicate belongsToUser(Root<AnnotationTarget> root, CriteriaBuilder cb, String username) { return cb.like(cb.lower(root.get(USER).get(USERNAME)), username.toLowerCase()); }