Class MongoItemReader<T>

    • Constructor Detail

      • MongoItemReader

        public MongoItemReader()
    • Method Detail

      • setQuery

        public void setQuery​(org.springframework.data.mongodb.core.query.Query query)
        A Mongo Query to be used.
        Parameters:
        query - Mongo Query to be used.
      • setTemplate

        public void setTemplate​(org.springframework.data.mongodb.core.MongoOperations template)
        Used to perform operations against the MongoDB instance. Also handles the mapping of documents to objects.
        Parameters:
        template - the MongoOperations instance to use
        See Also:
        MongoOperations
      • setQuery

        public void setQuery​(java.lang.String queryString)
        A JSON formatted MongoDB query. Parameterization of the provided query is allowed via ?<index> placeholders where the <index> indicates the index of the parameterValue to substitute.
        Parameters:
        queryString - JSON formatted Mongo query
      • setParameterValues

        public void setParameterValues​(java.util.List<java.lang.Object> parameterValues)
        List of values to be substituted in for each of the parameters in the query.
        Parameters:
        parameterValues - values
      • setFields

        public void setFields​(java.lang.String fields)
        JSON defining the fields to be returned from the matching documents by MongoDB.
        Parameters:
        fields - JSON string that identifies the fields to sort by.
      • setSort

        public void setSort​(java.util.Map<java.lang.String,​org.springframework.data.domain.Sort.Direction> sorts)
        Map of property names/Sort.Direction values to sort the input by.
        Parameters:
        sorts - map of properties and direction to sort each.
      • setCollection

        public void setCollection​(java.lang.String collection)
        Parameters:
        collection - Mongo collection to be queried.
      • setHint

        public void setHint​(java.lang.String hint)
        JSON String telling MongoDB what index to use.
        Parameters:
        hint - string indicating what index to use.
      • doPageRead

        protected java.util.Iterator<T> doPageRead()
        Description copied from class: AbstractPaginatedDataItemReader
        Method this ItemStreamReader delegates to for the actual work of reading a page. Each time this method is called, the resulting Iterator should contain the items read within the next page.

        If the Iterator is empty or null when it is returned, this ItemReader will assume that the input has been exhausted.
        Specified by:
        doPageRead in class AbstractPaginatedDataItemReader<T>
        Returns:
        an Iterator containing the items within a page.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Checks mandatory properties
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
        See Also:
        InitializingBean.afterPropertiesSet()