JPA findBy field ignore case JPA findBy field ignore case spring spring

JPA findBy field ignore case


Try something like this:

List<User> findByNameInIgnoreCase(List<String> userNames);


As I understood IgnoreCase is not supported with In key, so I changed code this way:

@Repositorypublic interface UserRepository {    @Query("select user from SysUser user where upper(name) in :userNames")    List<SysUser> findByNameIgnoreCaseIn(@Param("userNames") List<String> userNames);}

and previously upper case userNames values.