Skip to content

DATAJPA-876 - Update documentation for Spring Data JPA 1.10. #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.0.BUILD-SNAPSHOT</version>
<version>1.10.0.DATAJPA-876-SNAPSHOT</version>

<name>Spring Data JPA</name>
<description>Spring Data module for JPA repositories.</description>
Expand All @@ -26,7 +26,7 @@
<hsqldb1>1.8.0.10</hsqldb1>
<jpa>2.0.0</jpa>
<openjpa>2.4.1</openjpa>
<springdata.commons>1.12.0.BUILD-SNAPSHOT</springdata.commons>
<springdata.commons>1.12.0.DATACMNS-830-SNAPSHOT</springdata.commons>

<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>

Expand Down
25 changes: 22 additions & 3 deletions src/main/asciidoc/jpa.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ We will create a query using the JPA criteria API from this but essentially this
|Keyword|Sample|JPQL snippet
|`And`|`findByLastnameAndFirstname`|`… where x.lastname = ?1 and x.firstname = ?2`
|`Or`|`findByLastnameOrFirstname`|`… where x.lastname = ?1 or x.firstname = ?2`
|`Is,Equals`|`findByFirstname`,`findByFirstnameIs`,`findByFirstnameEquals`|`… where x.firstname = 1?`
|`Between`|`findByStartDateBetween`|`… where x.startDate between 1? and ?2`
|`Is,Equals`|`findByFirstname`,`findByFirstnameIs`,`findByFirstnameEquals`|`… where x.firstname = ?1`
|`Between`|`findByStartDateBetween`|`… where x.startDate between ?1 and ?2`
|`LessThan`|`findByAgeLessThan`|`… where x.age < ?1`
|`LessThanEqual`|`findByAgeLessThanEqual`|`… where x.age <= ?1`
|`GreaterThan`|`findByAgeGreaterThan`|`… where x.age > ?1`
Expand Down Expand Up @@ -445,6 +445,25 @@ public interface GroupRepository extends CrudRepository<GroupInfo, String> {
----
====

It is also possible to define _ad-hoc_ entity graphs via `@EntityGraph`. The provided `attributePaths` will be translated into the according `EntityGraph` without the need of having to explicitly add `@NamedEntityGraph` to your domain types.

.Using AD-HOC entity graph definition on an repository query method.
====
[source, java]
----
@Repository
public interface GroupRepository extends CrudRepository<GroupInfo, String> {

@EntityGraph(attributePaths = { "members" })
GroupInfo getByGroupName(String name);

}
----
====


include::{spring-data-commons-docs}/repository-projections.adoc[leveloffset=+2]

[[jpa.stored-procedures]]
== Stored procedures
The JPA 2.1 specification introduced support for calling stored procedures via the JPA criteria query API. We Introduced the `@Procedure` annotation for declaring stored procedure metadata on a repository method.
Expand All @@ -458,7 +477,7 @@ DROP procedure IF EXISTS plus1inout
/;
CREATE procedure plus1inout (IN arg int, OUT res int)
BEGIN ATOMIC
set res = arg ` 1;
set res = arg + 1;
END
/;
----
Expand Down