Skip to content

Commit d3017d1

Browse files
committed
spring-projects#282 - Changes in JavaDocs
1 parent 0bb11da commit d3017d1

File tree

4 files changed

+44
-10
lines changed

4 files changed

+44
-10
lines changed

Diff for: src/main/java/org/springframework/data/r2dbc/repository/query/ConditionFactory.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ class ConditionFactory {
3636
private final ParameterMetadataProvider parameterMetadataProvider;
3737

3838
/**
39-
* Creates new instance of this class with the given {@link MappingContext} and {@link ParameterMetadataProvider}.
39+
* Creates new instance of this class with the given {@link MappingContext}, {@link RenderNamingStrategy} and
40+
* {@link ParameterMetadataProvider}.
4041
*
4142
* @param mappingContext mapping context (must not be {@literal null})
4243
* @param namingStrategy naming strategy for SQL rendering (must not be {@literal null})
4344
* @param parameterMetadataProvider parameter metadata provider (must not be {@literal null})
4445
*/
45-
ConditionFactory(MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> mappingContext,
46+
ConditionFactory(MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty>
47+
mappingContext,
4648
RenderNamingStrategy namingStrategy,
4749
ParameterMetadataProvider parameterMetadataProvider) {
4850
Assert.notNull(mappingContext, "Mapping context must not be null");
@@ -59,6 +61,7 @@ class ConditionFactory {
5961
*
6062
* @param part method name part (must not be {@literal null})
6163
* @return {@link Condition} instance
64+
* @throws IllegalArgumentException if part type is not supported
6265
*/
6366
public Condition createCondition(Part part) {
6467
Part.Type type = part.getType();
@@ -215,6 +218,8 @@ private boolean canUpperCase(Class<?> expressionType) {
215218
// TODO: include support of functions in WHERE conditions into spring-data-relational
216219
/**
217220
* Models the ANSI SQL {@code UPPER} function.
221+
* <p>
222+
* Results in a rendered function: {@code UPPER(<expression>)}.
218223
*/
219224
private class Upper implements Expression {
220225
private Literal<Object> delegate;

Diff for: src/main/java/org/springframework/data/r2dbc/repository/query/ParameterMetadataProvider.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ParameterMetadataProvider {
4444
private final LikeEscaper likeEscaper;
4545

4646
/**
47-
* Creates new instance of this class with the given {@link RelationalParameterAccessor}.
47+
* Creates new instance of this class with the given {@link RelationalParameterAccessor} and {@link LikeEscaper}.
4848
*
4949
* @param accessor relational parameter accessor (must not be {@literal null}).
5050
* @param likeEscaper escaper for LIKE operator parameters (must not be {@literal null})
@@ -54,7 +54,7 @@ class ParameterMetadataProvider {
5454
}
5555

5656
/**
57-
* Creates new instance of this class with the given {@link Parameters}.
57+
* Creates new instance of this class with the given {@link Parameters} and {@link LikeEscaper}.
5858
*
5959
* @param parameters method parameters (must not be {@literal null})
6060
* @param likeEscaper escaper for LIKE operator parameters (must not be {@literal null})
@@ -64,8 +64,8 @@ class ParameterMetadataProvider {
6464
}
6565

6666
/**
67-
* Creates new instance of this class with the given {@link Parameters} and {@link Iterator} over all bindable
68-
* parameter values.
67+
* Creates new instance of this class with the given {@link Parameters}, {@link Iterator} over all bindable
68+
* parameter values and {@link LikeEscaper}.
6969
*
7070
* @param bindableParameterValueIterator iterator over bindable parameter values
7171
* @param parameters method parameters (must not be {@literal null})

Diff for: src/main/java/org/springframework/data/r2dbc/repository/query/PartTreeR2dbcQuery.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class PartTreeR2dbcQuery extends AbstractR2dbcQuery {
4545
private LikeEscaper likeEscaper = LikeEscaper.DEFAULT;
4646

4747
/**
48-
* Creates new instance of this class with the given {@link R2dbcQueryMethod} and {@link DatabaseClient}.
48+
* Creates new instance of this class with the given {@link R2dbcQueryMethod}, {@link DatabaseClient},
49+
* {@link R2dbcConverter} and {@link ReactiveDataAccessStrategy}.
4950
*
5051
* @param method query method (must not be {@literal null})
5152
* @param databaseClient database client (must not be {@literal null})
@@ -69,6 +70,12 @@ public PartTreeR2dbcQuery(R2dbcQueryMethod method,
6970
}
7071
}
7172

73+
/**
74+
* Creates new {@link BindableQuery} for the given {@link RelationalParameterAccessor}.
75+
*
76+
* @param accessor query parameter accessor (must not be {@literal null})
77+
* @return new instance of {@link BindableQuery}
78+
*/
7279
@Override
7380
protected BindableQuery createQuery(RelationalParameterAccessor accessor) {
7481
RelationalEntityMetadata<?> entityMetadata = getQueryMethod().getEntityInformation();

Diff for: src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryCreator.java

+25-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.stream.Collectors;
3737

3838
/**
39-
* Implementation of {@link AbstractQueryCreator} that creates {@link BindableQuery} from a {@link PartTree}.
39+
* Implementation of {@link AbstractQueryCreator} that creates SQL query from a {@link PartTree}.
4040
*
4141
* @author Roman Chigvintsev
4242
*/
@@ -77,27 +77,49 @@ public R2dbcQueryCreator(PartTree tree,
7777
namingStrategy, parameterMetadataProvider);
7878
}
7979

80+
/**
81+
* Creates {@link Condition} for the given method name part.
82+
*
83+
* @param part method name part (must not be {@literal null})
84+
* @param iterator iterator over query parameter values
85+
* @return new instance of {@link Condition}
86+
*/
8087
@Override
8188
protected Condition create(Part part, Iterator<Object> iterator) {
8289
return conditionFactory.createCondition(part);
8390
}
8491

92+
/**
93+
* Combines the given {@link Condition} with the new one created for the given method name part using {@code AND}.
94+
*
95+
* @param part method name part (must not be {@literal null})
96+
* @param base condition to be combined (must not be {@literal null})
97+
* @param iterator iterator over query parameter values
98+
* @return condition combination
99+
*/
85100
@Override
86101
protected Condition and(Part part, Condition base, Iterator<Object> iterator) {
87102
return base.and(conditionFactory.createCondition(part));
88103
}
89104

105+
/**
106+
* Combines two {@link Condition}s using {@code OR}.
107+
*
108+
* @param base condition to be combined (must not be {@literal null})
109+
* @param condition another condition to be combined (must not be {@literal null})
110+
* @return condition combination
111+
*/
90112
@Override
91113
protected Condition or(Condition base, Condition condition) {
92114
return base.or(condition);
93115
}
94116

95117
/**
96-
* Creates {@link BindableQuery} applying the given {@link Condition} and {@link Sort} definition.
118+
* Creates SQL query applying the given {@link Condition} and {@link Sort} definition.
97119
*
98120
* @param condition condition to be applied to query
99121
* @param sort sort option to be applied to query (must not be {@literal null})
100-
* @return new instance of {@link BindableQuery}
122+
* @return SQL query
101123
*/
102124
@Override
103125
protected String complete(Condition condition, Sort sort) {

0 commit comments

Comments
 (0)