From c8c26baf7c44df7f3b4f54439fba435c68c435a6 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 17 Sep 2012 11:24:46 +0200 Subject: [PATCH] DATACMNS-230 - Clarify packages of Page and Sort in reference docs. Fully qualified first mentions of Pageable and Sort to avoid ambiguities with types of potentially available types of the same name in a store specific implementation. --- src/docbkx/repositories.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/docbkx/repositories.xml b/src/docbkx/repositories.xml index 6560aecf6..ca1eb32c6 100644 --- a/src/docbkx/repositories.xml +++ b/src/docbkx/repositories.xml @@ -68,7 +68,7 @@ public interface CrudRepository<T, ID extends Serializable> extends Repository<T, ID> { - T save(T entity); + <S extends T> S save(S entity); T findOne(ID primaryKey); @@ -377,7 +377,7 @@ interface UserRepository extends MyBaseRepository<User, Long> { and providing a sorting direction (Asc or Desc). To create a query method that supports dynamic sorting have a look at . + linkend="repositories.special-parameters"/>.
Property expressions @@ -439,12 +439,14 @@ List<User> findByLastname(String lastname, Sort sort); List<User> findByLastname(String lastname, Pageable pageable); - The first method allows you to pass a Pageable - instance to the query method to dynamically add paging to your - statically defined query. Sorting options are handed via - the Pageable instance too. If you only - need sorting, simply add a Sort parameter to your method. - As you also can see, simply returning a + The first method allows you to pass a + org.springframework.data.domain.Pageable instance to the + query method to dynamically add paging to your statically defined + query. Sorting options are handed via the + Pageable instance too. If you only need + sorting, simply add an + org.springframework.data.domain.Sort parameter to your + method. As you also can see, simply returning a List is possible as well. We will then not retrieve the additional metadata required to build the actual Page instance but rather simply