Removed redundant logical checks from MongoItemReaderBuilder and MongoItemReader
to prevent false alarm for not providing the limit for query or pagesize for the reader Issue #3673
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
bd016a9444
commit
56fbc270e2
@@ -79,6 +79,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Michael Minella
|
||||
* @author Takaaki Iida
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Parikshit Dutta
|
||||
*/
|
||||
public class MongoItemReader<T> extends AbstractPaginatedDataItemReader<T> implements InitializingBean {
|
||||
|
||||
@@ -241,10 +242,6 @@ public class MongoItemReader<T> extends AbstractPaginatedDataItemReader<T> imple
|
||||
if (queryString != null) {
|
||||
Assert.state(sort != null, "A sort is required.");
|
||||
}
|
||||
|
||||
if (query != null && query.getLimit() != 0) {
|
||||
log.warn("PageSize in Query object was ignored. Please set it by MongoItemReader.setPageSize().");
|
||||
}
|
||||
}
|
||||
|
||||
private String replacePlaceholders(String input, List<Object> values) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Glenn Renfro
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Drummond Dawson
|
||||
* @author Parikshit Dutta
|
||||
* @since 4.0
|
||||
* @see MongoItemReader
|
||||
*/
|
||||
@@ -286,9 +287,6 @@ public class MongoItemReaderBuilder<T> {
|
||||
if(StringUtils.hasText(this.jsonQuery)) {
|
||||
Assert.notNull(this.sorts, "sorts map is required.");
|
||||
}
|
||||
else {
|
||||
Assert.state(this.query.getLimit() != 0, "PageSize in Query object was ignored.");
|
||||
}
|
||||
|
||||
MongoItemReader<T> reader = new MongoItemReader<>();
|
||||
reader.setTemplate(this.template);
|
||||
|
||||
Reference in New Issue
Block a user