Skip to content

Commit

Permalink
DATAJPA-251 - Polished reference documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Sep 17, 2012
1 parent 918099e commit 3b2818d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/docbkx/appendix/faq.xml
Expand Up @@ -29,7 +29,7 @@

<aop:config>
<aop:advisor advice-ref="customizableTraceInterceptor"
pointcut="execution(public * org.sfw.data.jpa.repository.JpaRepository+.*(..))"/>
pointcut="execution(public * org.springframework.data.jpa.repository.JpaRepository+.*(..))"/>
&lt;/aop:config&gt;</programlisting>
</answer>
</qandaentry>
Expand Down Expand Up @@ -62,8 +62,7 @@

<programlisting language="xml">&lt;bean class="com.acme.YourDaoBasedOnHibernateDaoSupport"&gt;
&lt;property name="sessionFactory"&gt;
&lt;bean factory-bean="entityManagerFactory"
factory-method="getSessionFactory" /&gt;
&lt;bean factory-bean="entityManagerFactory" factory-method="getSessionFactory" /&gt;
&lt;/property&gt;
&lt;/bean&gt;</programlisting>
</example>
Expand All @@ -89,4 +88,4 @@
</qandaentry>
</qandadiv>
</qandaset>
</appendix>
</appendix>
16 changes: 8 additions & 8 deletions src/docbkx/reference/jpa.xml
Expand Up @@ -98,7 +98,7 @@

<para>The Spring Data JPA repositories support cannot only be activated
through an XML namespace but also using an annotation through
JavaConfig. </para>
JavaConfig.</para>

<example id="id2371211_05-jpa">
<title>Spring Data JPA repositories using JavaConfig</title>
Expand Down Expand Up @@ -319,16 +319,16 @@ class ApplicationConfig {
<entry><code>findByFirstnameStartingWith</code></entry>

<entry><code>… where x.firstname like ?1</code> (parameter
bound with prepended <code>%</code>)</entry>
bound with appended <code>%</code>)</entry>
</row>

<row>
<entry><code>ngWith</code></entry>
<entry><code>EndingWith</code></entry>

<entry><code>findByFirstnameEndingWith</code></entry>

<entry><code>… where x.firstname like ?1</code> (parameter
bound with appended <code>%</code>)</entry>
bound with prepended <code>%</code>)</entry>
</row>

<row>
Expand Down Expand Up @@ -641,10 +641,10 @@ int setFixedFirstnameFor(String firstname, String lastname);</programlisting>
<para>The additional interface carries methods that allow you to execute
<interfacename>Specification</interfacename>s in a variety of ways.</para>

<para>For example, the <code>readAll</code> method will return all
<para>For example, the <code>findAll</code> method will return all
entities that match the specification:</para>

<programlisting language="java">List&lt;T&gt; readAll(Specification&lt;T&gt; spec);</programlisting>
<programlisting language="java">List&lt;T&gt; findAll(Specification&lt;T&gt; spec);</programlisting>

<para>The <interfacename>Specification</interfacename> interface is as
follows:</para>
Expand Down Expand Up @@ -716,7 +716,7 @@ int setFixedFirstnameFor(String firstname, String lastname);</programlisting>
<title>Combined Specifications</title>

<para><programlisting language="java">MonetaryAmount amount = new MonetaryAmount(200.0, Currencies.DOLLAR);
List&lt;Customer&gt; customers = customerRepository.readAll(
List&lt;Customer&gt; customers = customerRepository.findAll(
where(isLongTermCustomer()).or(hasSalesOfMoreThan(amount)));</programlisting>As
you can see, <classname>Specifications</classname> offers some glue-code
methods to chain and combine
Expand Down Expand Up @@ -784,7 +784,7 @@ class UserManagementImpl implements UserManagement {

Role role = roleRepository.findByName(roleName);

for (User user : userRepository.readAll()) {
for (User user : userRepository.findAll()) {
user.addRole(role);
userRepository.save(user);
}
Expand Down

0 comments on commit 3b2818d

Please sign in to comment.