Nullable JPA query in Kotlin
I am quite new at Spring Boot, Hibernate.
I have a repository method for the return count of users that matches the search query. For the search query, all parameters are optional.
I am using Spring Boot, Kotlin, Maven, and PostgreSQL for that.The Spring Boot version is 3.1.2, Java version is 17, and Kotlin version is 1.8.22.
For that, I wrote a query for my repository method below:
@Repository interface UserRepository : JpaRepository { @Query("select COUNT(u) from User u where (:email is...