-
Notifications
You must be signed in to change notification settings - Fork 695
allow Pageable and Sort in PartTree methods #2394
Conversation
@dzou Can you please help review this? Thanks! |
@@ -419,8 +419,8 @@ private static String getChildrenSubquery( | |||
return joiner.toString(); | |||
} | |||
|
|||
private static Pair<String, List<String>> buildPartTreeSqlString(PartTree tree, | |||
SpannerMappingContext spannerMappingContext, Class type) { | |||
private static SqlAndTags buildPartTreeSqlString(PartTree tree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this method to buildPartTreeSqlQuery
since it is returning a custom object rather than a string.
Also see below; suggestions for renaming SqlAndTags
which I think would be more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name reflects what this method does.
...er/src/main/java/org/springframework/cloud/gcp/data/spanner/repository/query/SqlAndTags.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/springframework/cloud/gcp/data/spanner/repository/query/SqlAndTags.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/springframework/cloud/gcp/data/spanner/repository/query/SqlAndTags.java
Outdated
Show resolved
Hide resolved
.../org/springframework/cloud/gcp/data/spanner/repository/query/SpannerStatementQueryTests.java
Outdated
Show resolved
Hide resolved
.../org/springframework/cloud/gcp/data/spanner/repository/query/SpannerStatementQueryTests.java
Outdated
Show resolved
Hide resolved
...g/springframework/cloud/gcp/data/spanner/repository/query/SpannerStatementQueryExecutor.java
Outdated
Show resolved
Hide resolved
...g/springframework/cloud/gcp/data/spanner/repository/query/SpannerStatementQueryExecutor.java
Outdated
Show resolved
Hide resolved
...g/springframework/cloud/gcp/data/spanner/repository/query/SpannerStatementQueryExecutor.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2394 +/- ##
============================================
+ Coverage 73.92% 73.93% +0.01%
- Complexity 2097 2102 +5
============================================
Files 260 261 +1
Lines 7577 7589 +12
Branches 785 789 +4
============================================
+ Hits 5601 5611 +10
- Misses 1614 1617 +3
+ Partials 362 361 -1
Continue to review full report at Codecov.
|
if (tree.isExistsProjection()) { | ||
stringBuilder.append(" LIMIT 1"); | ||
} | ||
else if (tree.isLimiting()) { | ||
stringBuilder.append(" LIMIT ").append(tree.getMaxResults()); | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do else if
* | ||
* @author Dmitry Solomakha | ||
* | ||
* @since 1.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.2.4
* | ||
* @since 1.2 | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space
@@ -181,6 +182,22 @@ public void queryMethodsTest() { | |||
.findByTraderId("trader2"); | |||
assertThat(trader2TradesRetrieved).containsExactlyInAnyOrderElementsOf(trader2Trades); | |||
|
|||
assertThat(this.tradeRepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, add test for limit in the method name and page request in the params. Which takes precedence?
Kudos, SonarCloud Quality Gate passed! 0 Bugs 90.5% Coverage The version of Java (1.8.0_151) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
fixes #2390