Criteria Builder 转换较低
Criteria Builder Convert Lower
我有以下谓词条件
predicate =
cb.like(root.get(Product_.prodName),prod.getProductName());
上面的lower怎么用,我试过了
predicate =
cb.like(cb.lower(root.get(Product_.prodName), prod.getProdName());
但是它给了我以下错误
method lower(javax.persistence.criteria.Path<java.lang.String>,
java.lang.String) not found in interface
javax.persistence.criteria.CriteriaBuilder
转换为 lower 的正确方法是什么?
将代码更改为
predicate =
criteriaBuilder.like(criteriaBuilder.lower(root.get(Product_.prodName)),
wrapper.getProdName());
我有以下谓词条件
predicate =
cb.like(root.get(Product_.prodName),prod.getProductName());
上面的lower怎么用,我试过了
predicate =
cb.like(cb.lower(root.get(Product_.prodName), prod.getProdName());
但是它给了我以下错误
method lower(javax.persistence.criteria.Path<java.lang.String>,
java.lang.String) not found in interface
javax.persistence.criteria.CriteriaBuilder
转换为 lower 的正确方法是什么?
将代码更改为
predicate =
criteriaBuilder.like(criteriaBuilder.lower(root.get(Product_.prodName)),
wrapper.getProdName());