Skip to content

Commit 8b10b6c

Browse files
committed
DATAJPA-1549 - Polishing.
Original pull requests: #238, #308.
1 parent 7788f87 commit 8b10b6c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/main/asciidoc/jpa.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,16 @@ The following table describes the keywords supported for JPA and what a method c
190190
|Keyword|Sample|JPQL snippet
191191
|`And`|`findByLastnameAndFirstname`|`… where x.lastname = ?1 and x.firstname = ?2`
192192
|`Or`|`findByLastnameOrFirstname`|`… where x.lastname = ?1 or x.firstname = ?2`
193-
|`Is,Equals`|`findByFirstname`,`findByFirstnameIs`,`findByFirstnameEquals`|`… where x.firstname = ?1`
193+
|`Is`, `Equals`|`findByFirstname`,`findByFirstnameIs`,`findByFirstnameEquals`|`… where x.firstname = ?1`
194194
|`Between`|`findByStartDateBetween`|`… where x.startDate between ?1 and ?2`
195195
|`LessThan`|`findByAgeLessThan`|`… where x.age < ?1`
196196
|`LessThanEqual`|`findByAgeLessThanEqual`|`… where x.age \<= ?1`
197197
|`GreaterThan`|`findByAgeGreaterThan`|`… where x.age > ?1`
198198
|`GreaterThanEqual`|`findByAgeGreaterThanEqual`|`… where x.age >= ?1`
199199
|`After`|`findByStartDateAfter`|`… where x.startDate > ?1`
200200
|`Before`|`findByStartDateBefore`|`… where x.startDate < ?1`
201-
|`IsNull`|`findByAge(Is)Null`|`… where x.age is null`
202-
|`IsNotNull,NotNull`|`findByAge(Is)NotNull`|`… where x.age not null`
201+
|`IsNull`, `Null`|`findByAge(Is)Null`|`… where x.age is null`
202+
|`IsNotNull`, `NotNull`|`findByAge(Is)NotNull`|`… where x.age not null`
203203
|`Like`|`findByFirstnameLike`|`… where x.firstname like ?1`
204204
|`NotLike`|`findByFirstnameNotLike`|`… where x.firstname not like ?1`
205205
|`StartingWith`|`findByFirstnameStartingWith`|`… where x.firstname like ?1` (parameter bound with appended `%`)

src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSourceUnitTests.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictP
102102
assertThat(attr.getOutputParameterType(), is(typeCompatibleWith(Integer.class)));
103103
assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME));
104104
}
105-
105+
106106
@Test // DATAJPA-1297
107107
public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictProcedureNameAliasAndOutputParameterName() {
108108

109-
StoredProcedureAttributes attr = creator
110-
.createFrom(method("explicitPlus1inoutViaProcedureNameAliasAndOutputParameterName", Integer.class), entityMetadata);
109+
StoredProcedureAttributes attr = creator.createFrom(
110+
method("explicitPlus1inoutViaProcedureNameAliasAndOutputParameterName", Integer.class), entityMetadata);
111111

112112
assertThat(attr.getProcedureName(), is("plus1inout"));
113113
assertThat(attr.getOutputParameterType(), is(typeCompatibleWith(Integer.class)));
@@ -164,7 +164,8 @@ private static Method method(String name, Class<?>... paramTypes) {
164164
/**
165165
* @author Thomas Darimont
166166
*/
167-
static interface DummyRepository {
167+
@SuppressWarnings("unused")
168+
interface DummyRepository {
168169

169170
/**
170171
* Explicitly mapped to a procedure with name "plus1inout" in database.
@@ -178,18 +179,19 @@ static interface DummyRepository {
178179
@Procedure(procedureName = "plus1inout") // DATAJPA-455
179180
Integer explicitPlus1inoutViaProcedureNameAlias(Integer arg);
180181

181-
/**
182-
* Explicitly mapped to a procedure with name "plus1inout" in database via alias and explicitly named ouput parameter.
182+
/**
183+
* Explicitly mapped to a procedure with name "plus1inout" in database via alias and explicitly named ouput
184+
* parameter.
183185
*/
184186
@Procedure(procedureName = "plus1inout", outputParameterName = "res") // DATAJPA-1297
185187
Integer explicitPlus1inoutViaProcedureNameAliasAndOutputParameterName(Integer arg);
186-
188+
187189
/**
188190
* Implicitly mapped to a procedure with name "plus1inout" in database via alias.
189191
*/
190192
@Procedure // DATAJPA-455
191193
Integer plus1inout(Integer arg);
192-
194+
193195
/**
194196
* Explicitly mapped to named stored procedure "User.plus1IO" in {@link EntityManager}.
195197
*/
@@ -209,9 +211,10 @@ static interface DummyRepository {
209211
Integer plus1inoutWithComposedAnnotationOverridingName(Integer arg);
210212
}
211213

214+
@SuppressWarnings("unused")
212215
@Procedure
213216
@Retention(RetentionPolicy.RUNTIME)
214-
static @interface ComposedProcedureUsingAliasFor {
217+
@interface ComposedProcedureUsingAliasFor {
215218

216219
@AliasFor(annotation = Procedure.class, attribute = "value")
217220
String dbProcedureName() default "";

0 commit comments

Comments
 (0)