Hibernate DefaultEntityAliases raises NullPointerException
I'm using Spring Boot, Spring Data REST, Hibernate (5.2.12.Final) and I'm exposing my repositories as REST services. I've a problem with a query that raises a NullPointerException and I don't understand the reason. I'm calling this method via a HTTP request (this is exposed by Spring Data REST). This is the code: @Transactional(readOnly = true) @PreAuthorize("isAuthenticated()") public interface CheckPointRepository extends JpaRepository<CheckPoint, Long> { @Query(value = "SELECT * FROM CheckPoint WHERE (:name IS NULL OR name LIKE CONCAT('%',:name,'%')) ORDER BY name LIMIT 20", nativeQuery =