Sql HQL语法异常,试图忽略区分大小写且在Spring引导中处于条件中

Sql HQL语法异常,试图忽略区分大小写且在Spring引导中处于条件中,sql,spring,spring-boot,hql,Sql,Spring,Spring Boot,Hql,试图避免第三个参数的大小写敏感性,即字符串列表(Cars) 通过在UPPER(?3)中使用(UPPER(t.cars)获取Hql语法异常 @Query("select t from Usert where UPPER(t.name) = UPPER(?1) and UPPER(t.age) = UPPER(?2) and (UPPER(t.cars) in UPPER(?3) )") List<User> findByNameAndAgeAndCars(String name

试图避免第三个参数的大小写敏感性,即字符串列表(Cars) 通过在UPPER(?3)中使用(UPPER(t.cars)获取Hql语法异常

@Query("select t from Usert where UPPER(t.name) = UPPER(?1) and UPPER(t.age) = UPPER(?2) and (UPPER(t.cars) in UPPER(?3) )")
    List<User> findByNameAndAgeAndCars(String name, String age, List<String> cars);
@Query(“从Usert中选择t,其中UPPER(t.name)=UPPER(?1)和UPPER(t.age)=UPPER(?2)和UPPER(t.cars)在UPPER(?3))中)
列出findByNameAndAgeAndCars(字符串名称、字符串年龄、列表汽车);

前两个参数可以与UPPER()一起使用,但条件中的字符串列表不能与UPPER一起使用如果有人知道解决方案,请先告诉我

for(int i=0; i<cars.size(); i++){
    cars.set(i, cars.get(i).toUpperCase());
}
@Query("select t from Usert where UPPER(t.name) = UPPER(?1) and UPPER(t.age) = UPPER(?2) and (UPPER(t.cars) in (?3) )")

我没有直接解决这个问题的方法,但有一个选项是在调用JPA repo方法之前将列表/集合上移。exceptionUPPER的共享堆栈跟踪只能应用于“String”类型的列,当您尝试将其用于集合时,它总是会失败。