From bd89c60715d2345509ddbbd2ed1103b29103ef0c Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 9 Feb 2011 16:35:42 +0100 Subject: [PATCH] Minor fixes to common reference documentation. - fixed some section ids in repository configuration - added namespace reference file --- src/docbkx/repositories.xml | 17 +-- src/docbkx/repository-namespace-reference.xml | 104 ++++++++++++++++++ 2 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 src/docbkx/repository-namespace-reference.xml diff --git a/src/docbkx/repositories.xml b/src/docbkx/repositories.xml index 8c5d51fa3..9e3bd4cc0 100644 --- a/src/docbkx/repositories.xml +++ b/src/docbkx/repositories.xml @@ -176,7 +176,8 @@ Page<User> users = repository.findAll(new PageRequest(1, 20);public class SomeClient { - @Autowired private PersonRepoyitory repository; + @Autowired + private PersonRepoyitory repository; public void doSomething() { List<Person> persons = repository.findByLastname("Matthews"); @@ -202,7 +203,7 @@ Page<User> users = repository.findAll(new PageRequest(1, 20); Defining query methods -
+
Query lookup strategies The next thing we have to discuss is the definition of query @@ -282,11 +283,13 @@ Page<User> users = repository.findAll(new PageRequest(1, 20); + Between, LessThan, + GreaterThan, Like for the + property expressions. As the operators supported can vary from + datastore to datastore please consult the according part of the + reference documentation. -
+
Property expressions Property expressions can just refer to a direct property of @@ -471,7 +474,7 @@ List<User> findByLastname(String lastname, Pageable pageable);Standalone usage of repository factory RepositoryFactorySupport factory = … // Instantiate factory here -UserRepository repository = factory.getRepository(UserRepository.class +UserRepository repository = factory.getRepository(UserRepository.class);
diff --git a/src/docbkx/repository-namespace-reference.xml b/src/docbkx/repository-namespace-reference.xml new file mode 100644 index 000000000..6190ea534 --- /dev/null +++ b/src/docbkx/repository-namespace-reference.xml @@ -0,0 +1,104 @@ + + + + Namespace reference + +
+ The <code><repositories /></code> element + + The <repositories /> element acts as container + for <repository /> elements or can be left empty to + trigger auto detection + see + of repository instances. Attributes defined for + <repositories /> act are propagated to contained + <repository /> elements but can be overridden of + course. + + + Attributes + + + + + + + + + Name + + Description + + + + + + base-package + + Defines the package to be used to be scanned for repository + interfaces extending *Repository + (actual interface is determined by specific Spring Data module) in + auto detection mode. All packages below the configured package + will be scanned, too. In auto configuration mode (no nested + <repository /> elements) wildcards are also + allowed. + + + + repository-impl-postfix + + Defines the postfix to autodetect custom repository + implementations. Classes whose names end with the configured + postfix will be considered as candidates. Defaults to + Impl. + + + + query-lookup-strategy + + Determines the strategy to be used to create finder + queries. See for + details. Defaults to create-if-not-found. + + + +
+
+ +
+ The <code><repository /></code> element + + The <repository /> element can contain all + attributes of <repositories /> except + base-package. This will result in overriding the values + configured in the surrounding <repositories /> element. + Thus here we will only document extended attributes. + + + Attributes + + + + + + + + + id + + Defines the id of the bean the repository instance will be + registered under as well as the repository interface name. + + + + custom-impl-ref + + Defines a reference to a custom repository implementation + bean. + + + +
+
+
\ No newline at end of file