|
42 | 42 | * @author Thomas Darimont
|
43 | 43 | * @author Oliver Gierke
|
44 | 44 | * @author Christoph Strobl
|
| 45 | + * @author Diego Diez |
45 | 46 | * @since 1.6
|
46 | 47 | */
|
47 | 48 | @RunWith(MockitoJUnitRunner.class)
|
@@ -101,6 +102,17 @@ public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictP
|
101 | 102 | assertThat(attr.getOutputParameterType(), is(typeCompatibleWith(Integer.class)));
|
102 | 103 | assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME));
|
103 | 104 | }
|
| 105 | + |
| 106 | + @Test // DATAJPA-1297 |
| 107 | + public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictProcedureNameAliasAndOutputParameterName() { |
| 108 | + |
| 109 | + StoredProcedureAttributes attr = creator |
| 110 | + .createFrom(method("explicitPlus1inoutViaProcedureNameAliasAndOutputParameterName", Integer.class), entityMetadata); |
| 111 | + |
| 112 | + assertThat(attr.getProcedureName(), is("plus1inout")); |
| 113 | + assertThat(attr.getOutputParameterType(), is(typeCompatibleWith(Integer.class))); |
| 114 | + assertThat(attr.getOutputParameterName(), is("res")); |
| 115 | + } |
104 | 116 |
|
105 | 117 | @Test // DATAJPA-455
|
106 | 118 | public void shouldCreateStoredProcedureAttributesFromProcedureMethodBackedWithExplicitlyNamedProcedure() {
|
@@ -166,12 +178,18 @@ static interface DummyRepository {
|
166 | 178 | @Procedure(procedureName = "plus1inout") // DATAJPA-455
|
167 | 179 | Integer explicitPlus1inoutViaProcedureNameAlias(Integer arg);
|
168 | 180 |
|
| 181 | + /** |
| 182 | + * Explicitly mapped to a procedure with name "plus1inout" in database via alias and explicityly named ouput parameter. |
| 183 | + */ |
| 184 | + @Procedure(procedureName = "plus1inout", outputParameterName = "res") // DATAJPA-1297 |
| 185 | + Integer explicitPlus1inoutViaProcedureNameAliasAndOutputParameterName(Integer arg); |
| 186 | + |
169 | 187 | /**
|
170 | 188 | * Implicitly mapped to a procedure with name "plus1inout" in database via alias.
|
171 | 189 | */
|
172 | 190 | @Procedure // DATAJPA-455
|
173 | 191 | Integer plus1inout(Integer arg);
|
174 |
| - |
| 192 | + |
175 | 193 | /**
|
176 | 194 | * Explicitly mapped to named stored procedure "User.plus1IO" in {@link EntityManager}.
|
177 | 195 | */
|
|
0 commit comments