DATAJPA-251 - Polished reference documentation.
This commit is contained in:
@@ -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+.*(..))"/>
|
||||
</aop:config></programlisting>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -62,8 +62,7 @@
|
||||
|
||||
<programlisting language="xml"><bean class="com.acme.YourDaoBasedOnHibernateDaoSupport">
|
||||
<property name="sessionFactory">
|
||||
<bean factory-bean="entityManagerFactory"
|
||||
factory-method="getSessionFactory" />
|
||||
<bean factory-bean="entityManagerFactory" factory-method="getSessionFactory" />
|
||||
</property>
|
||||
</bean></programlisting>
|
||||
</example>
|
||||
@@ -89,4 +88,4 @@
|
||||
</qandaentry>
|
||||
</qandadiv>
|
||||
</qandaset>
|
||||
</appendix>
|
||||
</appendix>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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<T> readAll(Specification<T> spec);</programlisting>
|
||||
<programlisting language="java">List<T> findAll(Specification<T> spec);</programlisting>
|
||||
|
||||
<para>The <interfacename>Specification</interfacename> interface is as
|
||||
follows:</para>
|
||||
@@ -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<Customer> customers = customerRepository.readAll(
|
||||
List<Customer> 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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user