diff --git a/jpa/jpa21/README.md b/jpa/jpa21/README.md index b99fb4d7..5b7ea2db 100644 --- a/jpa/jpa21/README.md +++ b/jpa/jpa21/README.md @@ -44,11 +44,11 @@ public interface UserRepository extends CrudRepository { Integer plus1BackedByOtherNamedStoredProcedure(@Param("arg") Integer arg); // Directly map the method to the stored procedure in the database (to avoid the annotation madness on your domain classes). - @Procedure("plus1inout") - Integer derivedStoredProcedureDeclaration(Integer arg); + @Procedure + Integer plus1inout(Integer arg); } ``` Calling `UserRepository.plus1BackedByOtherNamedStoredProcedure(…)` will execute the stored procedure `plus1inout` using the meta-data declared on the `User` domain class. -`UserRepository.derivedStoredProcedureDeclaration(…)` will use the stored procedure name declared in the annotation and default to positional parameter binding and expect a single output parameter of the backing stored procedure. \ No newline at end of file +`UserRepository.plus1inout(…)` will derive stored procedure metadata from the repository and default to positional parameter binding and expect a single output parameter of the backing stored procedure. \ No newline at end of file diff --git a/jpa/jpa21/pom.xml b/jpa/jpa21/pom.xml index 67a63ec4..b7081de3 100644 --- a/jpa/jpa21/pom.xml +++ b/jpa/jpa21/pom.xml @@ -12,7 +12,7 @@ Spring Data JPA - JPA 2.1 specific features - 1.6.0.DATAJPA-455-SNAPSHOT + 1.6.0.BUILD-SNAPSHOT \ No newline at end of file diff --git a/jpa/jpa21/src/main/java/example/springdata/jpa/storedprocedures/UserRepository.java b/jpa/jpa21/src/main/java/example/springdata/jpa/storedprocedures/UserRepository.java index 32922037..3f721e7a 100644 --- a/jpa/jpa21/src/main/java/example/springdata/jpa/storedprocedures/UserRepository.java +++ b/jpa/jpa21/src/main/java/example/springdata/jpa/storedprocedures/UserRepository.java @@ -42,6 +42,6 @@ public interface UserRepository extends CrudRepository { * Directly map the method to the stored procedure in the database (to avoid the annotation madness on your domain * classes). */ - @Procedure("plus1inout") - Integer derivedStoredProcedureDeclaration(Integer arg); + @Procedure + Integer plus1inout(Integer arg); } diff --git a/jpa/jpa21/src/test/java/example/springdata/jpa/storedprocedures/UserRepositoryIntegrationTests.java b/jpa/jpa21/src/test/java/example/springdata/jpa/storedprocedures/UserRepositoryIntegrationTests.java index 80b6c554..8f671a75 100644 --- a/jpa/jpa21/src/test/java/example/springdata/jpa/storedprocedures/UserRepositoryIntegrationTests.java +++ b/jpa/jpa21/src/test/java/example/springdata/jpa/storedprocedures/UserRepositoryIntegrationTests.java @@ -55,7 +55,7 @@ public class UserRepositoryIntegrationTests { */ @Test public void invokeDerivedStoredProcedure() { - assertThat(repository.derivedStoredProcedureDeclaration(1), is(2)); + assertThat(repository.plus1inout(1), is(2)); } // This is what it would look like implemented manually.