I upgraded from Spring Boot 2.7 to 3.0, hence from Hibernate 5 to Hibernate 6 Unfortunately the @Query annotations in a JpaRepository suddenly add not null checks for all columns using Sybase. It works fine with h2
and
results in the query select m1_0.my_user_id,m1_0.firstname,m1_0.lastname from my_user m1_0 where m1_0.firstname=? and m1_0.lastname=? which is obviously fine. But when I switch to Sybase
the query is select m1_0.my_user_id,m1_0.firstname,m1_0.lastname from my_user m1_0 where m1_0.firstname=? and m1_0.firstname is not null and m1_0.lastname=? and m1_0.lastname is not null with additional null checks. This breaks my code as it is no longer possible to pass null to the parameters in the getUser` method. |