I\'m not able to use Spring Data JPA projections and specifications together. I have the following setup:
Entity:
@Entity
public cla
@esdee: For now, I Created a Custom Repository Implementation where I created a dynamic query where you can create even a native query and map it to a DTO without using projections.
In order to do this you can see this doc:
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.custom-implementations
Here is a already example:
Spring Data JPA Custom Repository
Just keep in mind that if you want to make it pageable, in your Custom Repository you have to create also a method to count the rows, that you want to extract in your customFindAll(parameters). The disadgantage is that I rewrote the specifications in native query. But maybe the custom Implmentation can work also with Specification, let me know if it helps.
Regards, C