Class MongoItemReaderBuilder<T>
java.lang.Object
org.springframework.batch.item.data.builder.MongoItemReaderBuilder<T>
- Direct Known Subclasses:
MongoPagingItemReaderBuilder
Deprecated, for removal: This API element is subject to removal in a future version.
A builder implementation for the
MongoItemReader
- Since:
- 4.0
- Author:
- Glenn Renfro, Mahmoud Ben Hassine, Drummond Dawson, Parikshit Dutta
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Deprecated, for removal: This API element is subject to removal in a future version.protected int
Deprecated, for removal: This API element is subject to removal in a future version.protected String
Deprecated, for removal: This API element is subject to removal in a future version.protected String
Deprecated, for removal: This API element is subject to removal in a future version.protected String
Deprecated, for removal: This API element is subject to removal in a future version.protected int
Deprecated, for removal: This API element is subject to removal in a future version.protected String
Deprecated, for removal: This API element is subject to removal in a future version.protected int
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected org.springframework.data.mongodb.core.query.Query
Deprecated, for removal: This API element is subject to removal in a future version.protected boolean
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected org.springframework.data.mongodb.core.MongoOperations
Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Deprecated, for removal: This API element is subject to removal in a future version.Validates and builds aMongoItemReader
.collection
(String collection) Deprecated, for removal: This API element is subject to removal in a future version.Establish an optional collection that can be queried.currentItemCount
(int currentItemCount) Deprecated, for removal: This API element is subject to removal in a future version.Index for the current item.Deprecated, for removal: This API element is subject to removal in a future version.JSON defining the fields to be returned from the matching documents by MongoDB.Deprecated, for removal: This API element is subject to removal in a future version.JSON String telling MongoDB what index to use.Deprecated, for removal: This API element is subject to removal in a future version.A JSON formatted MongoDB jsonQuery.maxItemCount
(int maxItemCount) Deprecated, for removal: This API element is subject to removal in a future version.Configure the max number of items to be read.Deprecated, for removal: This API element is subject to removal in a future version.The name used to calculate the key within theExecutionContext
.pageSize
(int pageSize) Deprecated, for removal: This API element is subject to removal in a future version.The number of items to be read with each page.parameterValues
(Object... parameterValues) Deprecated, for removal: This API element is subject to removal in a future version.Values to be substituted in for each of the parameters in the query.parameterValues
(List<Object> parameterValues) Deprecated, for removal: This API element is subject to removal in a future version.List
of values to be substituted in for each of the parameters in the query.query
(org.springframework.data.mongodb.core.query.Query query) Deprecated, for removal: This API element is subject to removal in a future version.Provide a Spring Data MongoQuery
.saveState
(boolean saveState) Deprecated, for removal: This API element is subject to removal in a future version.Configure if the state of theItemStreamSupport
should be persisted within theExecutionContext
for restart purposes.Deprecated, for removal: This API element is subject to removal in a future version.Map
of property names/Sort.Direction
values to sort the input by.targetType
(Class<? extends T> targetType) Deprecated, for removal: This API element is subject to removal in a future version.The type of object to be returned for eachAbstractItemCountingItemStreamItemReader.read()
call.template
(org.springframework.data.mongodb.core.MongoOperations template) Deprecated, for removal: This API element is subject to removal in a future version.Used to perform operations against the MongoDB instance.
-
Field Details
-
template
protected org.springframework.data.mongodb.core.MongoOperations templateDeprecated, for removal: This API element is subject to removal in a future version. -
jsonQuery
Deprecated, for removal: This API element is subject to removal in a future version. -
targetType
Deprecated, for removal: This API element is subject to removal in a future version. -
sorts
Deprecated, for removal: This API element is subject to removal in a future version. -
hint
Deprecated, for removal: This API element is subject to removal in a future version. -
fields
Deprecated, for removal: This API element is subject to removal in a future version. -
collection
Deprecated, for removal: This API element is subject to removal in a future version. -
parameterValues
Deprecated, for removal: This API element is subject to removal in a future version. -
pageSize
protected int pageSizeDeprecated, for removal: This API element is subject to removal in a future version. -
saveState
protected boolean saveStateDeprecated, for removal: This API element is subject to removal in a future version. -
name
Deprecated, for removal: This API element is subject to removal in a future version. -
maxItemCount
protected int maxItemCountDeprecated, for removal: This API element is subject to removal in a future version. -
currentItemCount
protected int currentItemCountDeprecated, for removal: This API element is subject to removal in a future version. -
query
protected org.springframework.data.mongodb.core.query.Query queryDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
MongoItemReaderBuilder
public MongoItemReaderBuilder()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
saveState
Deprecated, for removal: This API element is subject to removal in a future version.Configure if the state of theItemStreamSupport
should be persisted within theExecutionContext
for restart purposes.- Parameters:
saveState
- defaults to true- Returns:
- The current instance of the builder.
-
name
Deprecated, for removal: This API element is subject to removal in a future version.The name used to calculate the key within theExecutionContext
. Required ifsaveState(boolean)
is set to true.- Parameters:
name
- name of the reader instance- Returns:
- The current instance of the builder.
- See Also:
-
maxItemCount
Deprecated, for removal: This API element is subject to removal in a future version.Configure the max number of items to be read.- Parameters:
maxItemCount
- the max items to be read- Returns:
- The current instance of the builder.
- See Also:
-
currentItemCount
Deprecated, for removal: This API element is subject to removal in a future version.Index for the current item. Used on restarts to indicate where to start from.- Parameters:
currentItemCount
- current index- Returns:
- this instance for method chaining
- See Also:
-
template
public MongoItemReaderBuilder<T> template(org.springframework.data.mongodb.core.MongoOperations template) Deprecated, for removal: This API element is subject to removal in a future version.Used to perform operations against the MongoDB instance. Also handles the mapping of documents to objects.- Parameters:
template
- the MongoOperations instance to use- Returns:
- The current instance of the builder
- See Also:
-
MongoOperations
MongoItemReader.setTemplate(MongoOperations)
-
jsonQuery
Deprecated, for removal: This API element is subject to removal in a future version.A JSON formatted MongoDB jsonQuery. Parameterization of the provided jsonQuery is allowed via ?<index> placeholders where the <index> indicates the index of the parameterValue to substitute.- Parameters:
query
- JSON formatted Mongo jsonQuery- Returns:
- The current instance of the builder
- See Also:
-
targetType
Deprecated, for removal: This API element is subject to removal in a future version.The type of object to be returned for eachAbstractItemCountingItemStreamItemReader.read()
call.- Parameters:
targetType
- the type of object to return- Returns:
- The current instance of the builder
- See Also:
-
parameterValues
Deprecated, for removal: This API element is subject to removal in a future version.List
of values to be substituted in for each of the parameters in the query.- Parameters:
parameterValues
- values- Returns:
- The current instance of the builder
- See Also:
-
parameterValues
Deprecated, for removal: This API element is subject to removal in a future version.Values to be substituted in for each of the parameters in the query.- Parameters:
parameterValues
- values- Returns:
- The current instance of the builder
- See Also:
-
fields
Deprecated, for removal: This API element is subject to removal in a future version.JSON defining the fields to be returned from the matching documents by MongoDB.- Parameters:
fields
- JSON string that identifies the fields to sort by.- Returns:
- The current instance of the builder
- See Also:
-
sorts
public MongoItemReaderBuilder<T> sorts(Map<String, org.springframework.data.domain.Sort.Direction> sorts) Deprecated, for removal: This API element is subject to removal in a future version.Map
of property names/Sort.Direction
values to sort the input by.- Parameters:
sorts
- map of properties and direction to sort each.- Returns:
- The current instance of the builder
- See Also:
-
collection
Deprecated, for removal: This API element is subject to removal in a future version.Establish an optional collection that can be queried.- Parameters:
collection
- Mongo collection to be queried.- Returns:
- The current instance of the builder
- See Also:
-
hint
Deprecated, for removal: This API element is subject to removal in a future version.JSON String telling MongoDB what index to use.- Parameters:
hint
- string indicating what index to use.- Returns:
- The current instance of the builder
- See Also:
-
pageSize
Deprecated, for removal: This API element is subject to removal in a future version.The number of items to be read with each page.- Parameters:
pageSize
- the number of items- Returns:
- this instance for method chaining
- See Also:
-
query
Deprecated, for removal: This API element is subject to removal in a future version.Provide a Spring Data MongoQuery
. This will take precedence over a JSON configured query.- Parameters:
query
- Query to execute- Returns:
- this instance for method chaining
- See Also:
-
build
Deprecated, for removal: This API element is subject to removal in a future version.Validates and builds aMongoItemReader
.- Returns:
- a
MongoItemReader
-
MongoPagingItemReaderBuilder
instead. Scheduled for removal in v5.3 or later.