Skip navigation links
org.alfresco.ibatis

Class RollupResultHandler

    • Constructor Detail

      • RollupResultHandler

        public RollupResultHandler(org.apache.ibatis.session.Configuration configuration,
                                   String[] keyProperties,
                                   String collectionProperty,
                                   org.apache.ibatis.session.ResultHandler resultHandler)
        Parameters:
        keyProperties - the properties that make up the unique key
        collectionProperty - the property mapped using a nested ResultMap
        resultHandler - the result handler that will receive the rolled-up results
      • RollupResultHandler

        public RollupResultHandler(org.apache.ibatis.session.Configuration configuration,
                                   String[] keyProperties,
                                   String collectionProperty,
                                   org.apache.ibatis.session.ResultHandler resultHandler,
                                   int maxResults)
        Parameters:
        keyProperties - the properties that make up the unique key
        collectionProperty - the property mapped using a nested ResultMap
        resultHandler - the result handler that will receive the rolled-up results
        maxResults - the maximum number of results to retrieve (-1 for no limit). Make sure that the query result limit is large enough to produce this at least this number of results
    • Method Detail

      • handleResult

        public void handleResult(org.apache.ibatis.session.ResultContext context)
        Specified by:
        handleResult in interface org.apache.ibatis.session.ResultHandler
      • processLastResults

        public void processLastResults()
        Client code must call this method once the query returns so that the final results can be passed to the inner RowHandler. If a query is limited by size, then it is possible that the unprocessed results represent an incomplete final object; in this case it would be best to ignore the last results. If the query is complete (i.e. all results are returned) then this method should be called.

        If you want X results and each result is made up of N rows (on average), then set the query limit to:
        L = X * (N+1)
        and don't call this method.

Copyright © 2005–2019 Alfresco Software. All rights reserved.