Be careful when using Spring Data:
Spring Data performs two queries: one to count and one to fetch when Page is returned. Instead, you can use Slice.
Page doesn’t make sense with Vaadins DataProvider because you either don’t provide a count or the count is separate from the fetch callback
Example project: GitHub - simasch/spring-data-page
2 Likes
Adam.87
(Adam Brusselback)
November 11, 2025, 3:32am
3
I’ve been cringing at my logs looking at the queries that are generated when I use the standard tooling rather than rolling my own queries for everything like I did in my old (Vaadin 7, then 17, then 21, then 24) app I used to manage.
It really is quite inefficient.
Always turn on SQL logging during development and analyze the queries
amagnolo
(alessandro magnolo)
November 13, 2025, 8:33am
5
I seems to me that the objection that you can’t use a Specification with Slice is still valid, although it should be solved in spring-data-jpa 4 (so usable in vaadin 25?)
1 Like