jpa case-insensitive in-clause for a list of string values

后端 未结 2 1674
执笔经年
执笔经年 2021-01-15 16:22

I want to know if JPQL is capable of doing a case-insensitive search on a collection of string.

Scenario:

Table1:

Column1 (int)  | Column2(s         


        
相关标签:
2条回答
  • 2021-01-15 16:47

    No you cannot. Reason is that UPPER and LOWER operate to the strings, so they do not take collection as argument.

    0 讨论(0)
  • 2021-01-15 16:48

    You can always do :

    from Table1 a where (upper(a.column2) = upper(:value1) 
        or upper(a.column2) = upper(:value2) 
        or ...)
    
    0 讨论(0)
提交回复
热议问题