In our Spring Boot project, we do use spring.aot.repositories.enabled.
Let's consider this repository:
public interface ThingRepository extends JpaRepository<Thing, UUID> {
@Query("SELECT t FROM Thing t WHERE t.groupId = :groupId")
List<Thing> findByGroupId(UUID groupId);
}
where groupId is nullable.
The AOT-generated method will be:
public List<Thing> findByGroupId(UUID groupId) {
String var2 = "SELECT t FROM Thing t WHERE t.groupId = :groupId";
Query var3 = this.entityManager.createQuery(var2);
var3.setParameter("groupId", groupId);
return var3.getResultList();
}
It works until groupId is null; the final query does not use IS NULL.
I didn't try to annotate the field @Nullable as I don't expect such behavior to be driven by those annotations.
Spring Boot: 4.1.0
MacOs: 26.5.1
In our Spring Boot project, we do use
spring.aot.repositories.enabled.Let's consider this repository:
where
groupIdis nullable.The AOT-generated method will be:
It works until
groupIdis null; the final query does not useIS NULL.I didn't try to annotate the field
@Nullableas I don't expect such behavior to be driven by those annotations.Spring Boot: 4.1.0
MacOs: 26.5.1