Closed stefanw25 closed 5 months ago
Right now, this is expected behavior as the backing implementation returns domain objects for findAll
.
Projections only work with non-base-repository methods such as findAllBy()
(note the added By
). These methods do not shadow base repository methods.
Thank you very much. Using findAllBy()
works wonderfully.
When having a repository return a Kotlin data class, it won't be able to convert the entity to the data class dto. The functionality that I want to use is described here in the spring data JPA documentation.
Instead, a ConverterNotFoundException is raised:
I've created a minimal reproducible example here: https://github.com/stefanw25/spring-data-dto-projection-minimal
Spring Boot version: 3.3.0