Hi
Spring Data JPA introduced new Limit functionality to provide dynamic limiting. So if earlier we wrote the following query:
List<Product> findTop3By();
List<Product> findFirst3By();
and now we can use new approach:
List<Product> findBy(Limit limit);
But I noticed that resulting SQL in the first two queries was :
SELECT * from Product p1_0 fetch first ? rows only
And now it's:
SELECT * from Product p1_0 offset ? rows fetch first ? rows only
So why do we need additional parameter offset? I guess it's redundant and not needed here.
Hi
Spring Data JPA introduced new Limit functionality to provide dynamic limiting. So if earlier we wrote the following query:
and now we can use new approach:
List<Product> findBy(Limit limit);But I noticed that resulting SQL in the first two queries was :
SELECT * from Product p1_0 fetch first ? rows onlyAnd now it's:
SELECT * from Product p1_0 offset ? rows fetch first ? rows onlySo why do we need additional parameter offset? I guess it's redundant and not needed here.