Browse Source

Minor fixes to common reference documentation.

- fixed some section ids in repository configuration
- added namespace reference file
pull/2/head
Oliver Gierke 15 years ago
parent
commit
bd89c60715
  1. 17
      src/docbkx/repositories.xml
  2. 104
      src/docbkx/repository-namespace-reference.xml

17
src/docbkx/repositories.xml

@ -176,7 +176,8 @@ Page&lt;User&gt; users = repository.findAll(new PageRequest(1, 20);</programlist
<programlisting language="java">public class SomeClient { <programlisting language="java">public class SomeClient {
@Autowired private PersonRepoyitory repository; @Autowired
private PersonRepoyitory repository;
public void doSomething() { public void doSomething() {
List&lt;Person&gt; persons = repository.findByLastname("Matthews"); List&lt;Person&gt; persons = repository.findByLastname("Matthews");
@ -202,7 +203,7 @@ Page&lt;User&gt; users = repository.findAll(new PageRequest(1, 20);</programlist
<section> <section>
<title>Defining query methods</title> <title>Defining query methods</title>
<section> <section id="repositories.query-methods.query-lookup-strategies">
<title>Query lookup strategies</title> <title>Query lookup strategies</title>
<para>The next thing we have to discuss is the definition of query <para>The next thing we have to discuss is the definition of query
@ -282,11 +283,13 @@ Page&lt;User&gt; users = repository.findAll(new PageRequest(1, 20);</programlist
traversals combined with operators that can be concatenated. As you traversals combined with operators that can be concatenated. As you
can see in the example you can combine property expressions with And can see in the example you can combine property expressions with And
and Or. Beyond that you will get support for various operators like and Or. Beyond that you will get support for various operators like
Between, LessThan, GreaterThan, Like for the property expressions. As <literal>Between</literal>, <literal>LessThan</literal>,
the operators supported can vary from datastore to datastore please <literal>GreaterThan</literal>, <literal>Like</literal> for the
consult the according part of the reference documentation.</para> property expressions. As the operators supported can vary from
datastore to datastore please consult the according part of the
reference documentation.</para>
<section> <section id="repositories.query-methods.property-expressions">
<title>Property expressions</title> <title>Property expressions</title>
<para>Property expressions can just refer to a direct property of <para>Property expressions can just refer to a direct property of
@ -471,7 +474,7 @@ List&lt;User&gt; findByLastname(String lastname, Pageable pageable);</programlis
<title>Standalone usage of repository factory</title> <title>Standalone usage of repository factory</title>
<programlisting>RepositoryFactorySupport factory = … // Instantiate factory here <programlisting>RepositoryFactorySupport factory = … // Instantiate factory here
UserRepository repository = factory.getRepository(UserRepository.class</programlisting> UserRepository repository = factory.getRepository(UserRepository.class);</programlisting>
</example> </example>
</section> </section>
</section> </section>

104
src/docbkx/repository-namespace-reference.xml

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<appendix id="namespace-reference">
<title>Namespace reference</title>
<section id="namespace-dao-config">
<title>The <code>&lt;repositories /&gt;</code> element</title>
<para>The <code>&lt;repositories /&gt;</code> element acts as container
for <code>&lt;repository /&gt;</code> elements or can be left empty to
trigger auto detection<footnote>
<para>see <xref linkend="config.autoconfig" /></para>
</footnote> of repository instances. Attributes defined for
<code>&lt;repositories /&gt;</code> act are propagated to contained
<code>&lt;repository /&gt;</code> elements but can be overridden of
course.</para>
<table>
<title>Attributes</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="2*" />
<thead>
<row>
<entry>Name</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><code>base-package</code></entry>
<entry>Defines the package to be used to be scanned for repository
interfaces extending <interfacename>*Repository</interfacename>
(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
<code>&lt;repository /&gt;</code> elements) wildcards are also
allowed.</entry>
</row>
<row>
<entry><code>repository-impl-postfix</code></entry>
<entry>Defines the postfix to autodetect custom repository
implementations. Classes whose names end with the configured
postfix will be considered as candidates. Defaults to
<code>Impl</code>.</entry>
</row>
<row>
<entry><code>query-lookup-strategy</code></entry>
<entry>Determines the strategy to be used to create finder
queries. See <xref linkend="sample-app.finders.strategies" /> for
details. Defaults to <code>create-if-not-found</code>.</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="namespace-dao">
<title>The <code>&lt;repository /&gt;</code> element</title>
<para>The <code>&lt;repository /&gt;</code> element can contain all
attributes of <code>&lt;repositories /&gt;</code> except
<code>base-package</code>. This will result in overriding the values
configured in the surrounding <code>&lt;repositories /&gt;</code> element.
Thus here we will only document extended attributes.</para>
<table>
<title>Attributes</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="2*" />
<tbody>
<row>
<entry><code>id</code></entry>
<entry>Defines the id of the bean the repository instance will be
registered under as well as the repository interface name.</entry>
</row>
<row>
<entry><code>custom-impl-ref</code></entry>
<entry>Defines a reference to a custom repository implementation
bean.</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</appendix>
Loading…
Cancel
Save