Skip to content

Redundant parameter in the Limit query #3242

@sergey-morenets

Description

@sergey-morenets

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions