对不起,经过几天几夜的使用的研究得出这种方式是无法实现的,在查询上的关键字只有这些:

https://docs.spring.io/spring-data/jpa/docs/2.1.x/reference/html/#_supported_query_keywords

https://docs.spring.io/spring-data/jpa/docs/2.1.x/reference/html/#repository-query-keywords

要想实现比如CAST这些函数就必须要自己手写SQL语句。又或者这样用:

predicates.add(criteriaBuilder.like(criteriaBuilder.lower(root.get("industryId").as(String.class)),"%1%"));

查询时使用as转换成String,这样声称出来的SQL就是CAST函数。

相关文章:

  • 2022-12-23
  • 2022-02-10
  • 2021-10-20
  • 2022-01-14
  • 2021-06-16
  • 2021-11-26
  • 2022-12-23
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-01-25
  • 2021-10-21
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案