spring-projects/spring-data-commons — pull request #85 by thomasdarimont (2014-06-05 12:35:12+00:00)
Title: DATACMNS-516 - Add support for limiting the query result in the query derivation mechanism.

We can now detect whether a given query method wants to limit the query results based on two new supported prefixes (findFirstBy and findFirstKBy) where "First" part can also be replaced by "Top" and an following optional K (which must be a decimal int) that denotes the maximal number of result rows to be retuned by the query.

This can be used by the stores to allow queries like:
T findFirstByXXXOrderByYYYYAsc (=smallest)
T findFirstByXXXOrderByYYYYDesc (=greatest)
T findTopByXXXOrderByYYYYDesc (=greatest)
T findFirstByXXX(Sort sort) (general purpose)
T findTopByXXX(Sort sort) (general purpose)
List findFirstKByXXXOrderByYYYYAsc (=smallest K)
List findFirstKByXXXOrderByYYYYDesc (=biggest K)
List findFirstKByXXX(Sort sort) (general purpose TOP K)
List findTopKByXXX(Sort sort) (general purpose TOP K)