字符串值列表的jpa in子句不区分大小写

字符串值列表的jpa in子句不区分大小写,jpa,jpa-2.0,jpql,Jpa,Jpa 2.0,Jpql,我想知道JPQL是否能够对字符串集合进行不区分大小写的搜索 脚本: 表1: 我正在寻找一个JPQL查询,它可以执行类似的操作 from Table1 a where upper(a.column2) in upper(:listOfCol2Values) 我可以实现这一点,而不必在设置集合的应用程序代码处更改大小写 干杯。不,你不能。原因是“上”和“下”操作字符串,所以它们不以“集合”作为参数。您始终可以执行以下操作: from Table1 a where (upper(a.column2)

我想知道JPQL是否能够对字符串集合进行不区分大小写的搜索

脚本: 表1: 我正在寻找一个JPQL查询,它可以执行类似的操作

from Table1 a where upper(a.column2) in upper(:listOfCol2Values)
我可以实现这一点,而不必在设置集合的应用程序代码处更改大小写


干杯。

不,你不能。原因是“上”和“下”操作字符串,所以它们不以“集合”作为参数。

您始终可以执行以下操作:

from Table1 a where (upper(a.column2) = upper(:value1) 
    or upper(a.column2) = upper(:value2) 
    or ...)

为此,您必须使用Criteria Builder谢谢。不幸的是,这听起来像是我的额外工作。
from Table1 a where (upper(a.column2) = upper(:value1) 
    or upper(a.column2) = upper(:value2) 
    or ...)