I have a spring boot application with @RestController and within that I got a @GetMapping Method, in which I return a List of DTOs from a Native Query to my Client. Now I wanted to add pagination.
But since my Method is not returning an entity but an DTO, which contains fields of three related entities it makes it difficult for me to find an proper way to do this. I have already tried some approaches of people with similar problems but none of those were helping me and a lot of them are deprecated I think.
So my Question is: How can I return a Page of type DTO to my frontend? The Native Query returns a List of type DTO.