Skip to content

Commit b51c77b

Browse files
committed
Polishing.
Minor formatting and references to GH issues. See #1714 Original pull request #1963
1 parent ea29642 commit b51c77b

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateTemplate.java

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ public <T> List<T> findAll(Class<T> domainType) {
344344

345345
@Override
346346
public <T> Stream<T> streamAll(Class<T> domainType) {
347+
347348
Iterable<T> items = triggerAfterConvert(accessStrategy.findAll(domainType));
348349
return StreamSupport.stream(items.spliterator(), false).map(this::triggerAfterConvert);
349350
}

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java

+3
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public <T> List<T> findAll(Class<T> domainType) {
269269

270270
@Override
271271
public <T> Stream<T> streamAll(Class<T> domainType) {
272+
272273
String statement = namespace(domainType) + ".streamAll";
273274
MyBatisContext parameter = new MyBatisContext(null, null, domainType, Collections.emptyMap());
274275
Cursor<T> cursor = sqlSession().selectCursor(statement, parameter);
@@ -277,12 +278,14 @@ public <T> Stream<T> streamAll(Class<T> domainType) {
277278

278279
@Override
279280
public <T> List<T> findAllById(Iterable<?> ids, Class<T> domainType) {
281+
280282
return sqlSession().selectList(namespace(domainType) + ".findAllById",
281283
new MyBatisContext(ids, null, domainType, Collections.emptyMap()));
282284
}
283285

284286
@Override
285287
public <T> Stream<T> streamAllByIds(Iterable<?> ids, Class<T> domainType) {
288+
286289
String statement = namespace(domainType) + ".streamAllByIds";
287290
MyBatisContext parameter = new MyBatisContext(ids, null, domainType, Collections.emptyMap());
288291
Cursor<T> cursor = sqlSession().selectCursor(statement, parameter);

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/AbstractJdbcAggregateTemplateIntegrationTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ void findByNonPropertySortFails() {
389389

390390
@Test // GH-1714
391391
void findByNonPropertySortLikeStreamFails() {
392+
392393
assertThatThrownBy(() -> template.streamAll(LegoSet.class, Sort.by("somethingNotExistant")))
393394
.isInstanceOf(InvalidPersistentPropertyPath.class);
394395
}

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategyUnitTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void findAll() {
247247
);
248248
}
249249

250-
@Test
250+
@Test // GH-1714
251251
public void streamAll() {
252252

253253
String value = "some answer";
@@ -299,7 +299,7 @@ public void findAllById() {
299299
);
300300
}
301301

302-
@Test
302+
@Test // GH-1714
303303
public void streamAllByIds() {
304304

305305
String value = "some answer 2";
@@ -430,7 +430,7 @@ public void findAllSorted() {
430430
);
431431
}
432432

433-
@Test
433+
@Test // GH-1714
434434
public void streamAllSorted() {
435435

436436
String value = "some answer 3";

0 commit comments

Comments
 (0)