spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.
https://spring.io/projects/spring-data-jpa/
Apache License 2.0
2.93k stars 1.39k forks source link

Cannot use "IgnoreCase" in Spring boot data JPA with SQL server database #3399

Closed woekeierokfod closed 3 months ago

woekeierokfod commented 3 months ago

I'm trying to communicate with an SQL server database locally via Spring boot and Spring boot data jpa and I get the following error :

org.hibernate.QueryException: Parameter 1 of function upper() has type STRING, but argument is of type java.lang.String My method is defined as following :

public interface UserRepository extends JpaRepository<User, Integer> { Optional<User> findByEmailIgnoreCase(String email); }

It seems like SQL server does not support "IgnoreCase" once removed the code works. is there a reason why I get this error the type is String.

christophstrobl commented 3 months ago

From what is provided in the description this looks like a hibernate issue. Have you tried to reproduce the behaviour with plain jpa/hibernate?

spring-projects-issues commented 3 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues commented 3 months ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.