Polishing.
Minor formatting and references to GH issues. See #1714 Original pull request #1963
This commit is contained in:
@@ -344,6 +344,7 @@ public class JdbcAggregateTemplate implements JdbcAggregateOperations {
|
||||
|
||||
@Override
|
||||
public <T> Stream<T> streamAll(Class<T> domainType) {
|
||||
|
||||
Iterable<T> items = triggerAfterConvert(accessStrategy.findAll(domainType));
|
||||
return StreamSupport.stream(items.spliterator(), false).map(this::triggerAfterConvert);
|
||||
}
|
||||
|
||||
@@ -269,6 +269,7 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy {
|
||||
|
||||
@Override
|
||||
public <T> Stream<T> streamAll(Class<T> domainType) {
|
||||
|
||||
String statement = namespace(domainType) + ".streamAll";
|
||||
MyBatisContext parameter = new MyBatisContext(null, null, domainType, Collections.emptyMap());
|
||||
Cursor<T> cursor = sqlSession().selectCursor(statement, parameter);
|
||||
@@ -277,12 +278,14 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy {
|
||||
|
||||
@Override
|
||||
public <T> List<T> findAllById(Iterable<?> ids, Class<T> domainType) {
|
||||
|
||||
return sqlSession().selectList(namespace(domainType) + ".findAllById",
|
||||
new MyBatisContext(ids, null, domainType, Collections.emptyMap()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Stream<T> streamAllByIds(Iterable<?> ids, Class<T> domainType) {
|
||||
|
||||
String statement = namespace(domainType) + ".streamAllByIds";
|
||||
MyBatisContext parameter = new MyBatisContext(ids, null, domainType, Collections.emptyMap());
|
||||
Cursor<T> cursor = sqlSession().selectCursor(statement, parameter);
|
||||
|
||||
@@ -389,6 +389,7 @@ abstract class AbstractJdbcAggregateTemplateIntegrationTests {
|
||||
|
||||
@Test // GH-1714
|
||||
void findByNonPropertySortLikeStreamFails() {
|
||||
|
||||
assertThatThrownBy(() -> template.streamAll(LegoSet.class, Sort.by("somethingNotExistant")))
|
||||
.isInstanceOf(InvalidPersistentPropertyPath.class);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public class MyBatisDataAccessStrategyUnitTests {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // GH-1714
|
||||
public void streamAll() {
|
||||
|
||||
String value = "some answer";
|
||||
@@ -299,7 +299,7 @@ public class MyBatisDataAccessStrategyUnitTests {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // GH-1714
|
||||
public void streamAllByIds() {
|
||||
|
||||
String value = "some answer 2";
|
||||
@@ -430,7 +430,7 @@ public class MyBatisDataAccessStrategyUnitTests {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // GH-1714
|
||||
public void streamAllSorted() {
|
||||
|
||||
String value = "some answer 3";
|
||||
|
||||
Reference in New Issue
Block a user