function _AggregationCache(oRequestor, sResourcePath, oAggregation, mQueryOptions,
			bHasGrandTotal) {
		var fnCount = function () {}, // no specific handling needed for "UI5__count" here
			fnLeaves = null,
			that = this;

		_Cache.call(this, oRequestor, sResourcePath, mQueryOptions, true);

		this.oAggregation = oAggregation;
		this.sDownloadUrl = _Cache.prototype.getDownloadUrl.call(this, "");
		this.aElements = [];
		this.aElements.$byPredicate = {};
		this.aElements.$count = undefined;
		this.aElements.$created = 0; // required for _Cache#drillDown (see _Cache.from$skip)
		this.oLeavesPromise = undefined;
		if (mQueryOptions.$count && oAggregation.groupLevels.length) {
			mQueryOptions.$$leaves = true; // do this after #getDownloadUrl
			this.oLeavesPromise = new SyncPromise(function (resolve) {
				fnLeaves = function (oLeaves) {
					// Note: count is of type Edm.Int64, represented as a string in OData responses;
					// $count should be a number and the loss of precision is acceptable
					resolve(parseInt(oLeaves.UI5__leaves));
				};
			});
		}
		this.oFirstLevel = this.createGroupLevelCache(null, bHasGrandTotal || !!fnLeaves);
		this.oGrandTotalPromise = undefined;
		if (bHasGrandTotal) {
			this.oGrandTotalPromise = new SyncPromise(function (resolve) {
				_ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves,
					function (oGrandTotal) {
						var oGrandTotalCopy;

						if (oAggregation["grandTotal like 1.84"]) { // rename measures
							_AggregationHelper.removeUI5grand__(oGrandTotal);
						}
						_AggregationHelper.setAnnotations(oGrandTotal, true, true, 0,
							_AggregationHelper.getAllProperties(oAggregation));

						if (oAggregation.grandTotalAtBottomOnly === false) {
							// Note: make shallow copy *before* there are private annotations!
							oGrandTotalCopy = Object.assign({}, oGrandTotal, {
									"@$ui5.node.isExpanded" : undefined // treat copy as a leaf
								});
							_Helper.setPrivateAnnotation(oGrandTotal, "copy", oGrandTotalCopy);
							_Helper.setPrivateAnnotation(oGrandTotalCopy, "predicate",
								"($isTotal=true)");
						}
						_Helper.setPrivateAnnotation(oGrandTotal, "predicate", "()");

						resolve(oGrandTotal);
					}, fnCount]);
			});
		} else if (fnLeaves) {
			_ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves, fnCount]);
		}
	}
/**
	 * Creates a cache for data aggregation that performs requests using the given requestor.
	 * Note: The paths in $expand and $select will always be sorted in the cache's query string.
	 * This kind of cache is only used if grand totals or group levels are involved!
	 *
	 * @param {sap.ui.model.odata.v4.lib._Requestor} oRequestor
	 *   The requestor
	 * @param {string} sResourcePath
	 *   A resource path relative to the service URL
	 * @param {object} oAggregation
	 *   An object holding the information needed for data aggregation; see also
	 *   <a href="http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/">OData
	 *   Extension for Data Aggregation Version 4.0</a>; must already be normalized by
	 *   {@link _AggregationHelper.buildApply}
	 * @param {object} mQueryOptions
	 *   A map of key-value pairs representing the query string
	 * @param {boolean} bHasGrandTotal
	 *   Whether a grand total is needed
	 *
	 * @alias sap.ui.model.odata.v4.lib._AggregationCache
	 * @constructor
	 * @extends sap.ui.model.odata.v4.lib._Cache
	 * @private
	 */
Creates a cache for data aggregation that performs requests using the given requestor.
Note: The paths in $expand and $select will always be sorted in the cache's query string.
This kind of cache is only used if grand totals or group levels are involved!




Creates a cache for data aggregation that performs requests using the given requestor . Note : The paths in $expand and $select will always be sorted in the cache ' s query string . This kind of cache is only used if grand totals or group levels are involved!
function _AggregationCache(oRequestor, sResourcePath, oAggregation, mQueryOptions,
			bHasGrandTotal) {
		var fnCount = function () {}, 
			fnLeaves = null,
			that = this;
		_Cache.call(this, oRequestor, sResourcePath, mQueryOptions, true);
		this.oAggregation = oAggregation;
		this.sDownloadUrl = _Cache.prototype.getDownloadUrl.call(this, "");
		this.aElements = [];
		this.aElements.$byPredicate = {};
		this.aElements.$count = undefined;
		this.aElements.$created = 0; 
		this.oLeavesPromise = undefined;
		if (mQueryOptions.$count && oAggregation.groupLevels.length) {
			mQueryOptions.$$leaves = true; 
			this.oLeavesPromise = new SyncPromise(function (resolve) {
				fnLeaves = function (oLeaves) {
					resolve(parseInt(oLeaves.UI5__leaves));
				};
			});
		}
		this.oFirstLevel = this.createGroupLevelCache(null, bHasGrandTotal || !!fnLeaves);
		this.oGrandTotalPromise = undefined;
		if (bHasGrandTotal) {
			this.oGrandTotalPromise = new SyncPromise(function (resolve) {
				_ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves,
					function (oGrandTotal) {
						var oGrandTotalCopy;
						if (oAggregation["grandTotal like 1.84"]) { 
							_AggregationHelper.removeUI5grand__(oGrandTotal);
						}
						_AggregationHelper.setAnnotations(oGrandTotal, true, true, 0,
							_AggregationHelper.getAllProperties(oAggregation));
						if (oAggregation.grandTotalAtBottomOnly === false) {
							oGrandTotalCopy = Object.assign({}, oGrandTotal, {
									"@$ui5.node.isExpanded" : undefined 
								});
							_Helper.setPrivateAnnotation(oGrandTotal, "copy", oGrandTotalCopy);
							_Helper.setPrivateAnnotation(oGrandTotalCopy, "predicate",
								"($isTotal=true)");
						}
						_Helper.setPrivateAnnotation(oGrandTotal, "predicate", "()");
						resolve(oGrandTotal);
					}, fnCount]);
			});
		} else if (fnLeaves) {
			_ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves, fnCount]);
		}
	}
function _AggregationCache ( oRequestor , sResourcePath , oAggregation , mQueryOptions , bHasGrandTotal ) { var fnCount = function ( ) { } , fnLeaves = null , that = this ; _Cache . call ( this , oRequestor , sResourcePath , mQueryOptions , true ) ; this . oAggregation = oAggregation ; this . sDownloadUrl = _Cache . prototype . getDownloadUrl . call ( this , "" ) ; this . aElements = [ ] ; this . aElements . $byPredicate = { } ; this . aElements . $count = undefined ; this . aElements . $created = 0 ; this . oLeavesPromise = undefined ; if ( mQueryOptions . $count && oAggregation . groupLevels . length ) { mQueryOptions . $$leaves = true ; this . oLeavesPromise = new SyncPromise ( function ( resolve ) { fnLeaves = function ( oLeaves ) { resolve ( parseInt ( oLeaves . UI5__leaves ) ) ; } ; } ) ; } this . oFirstLevel = this . createGroupLevelCache ( null , bHasGrandTotal || ! ! fnLeaves ) ; this . oGrandTotalPromise = undefined ; if ( bHasGrandTotal ) { this . oGrandTotalPromise = new SyncPromise ( function ( resolve ) { _ConcatHelper . enhanceCache ( that . oFirstLevel , oAggregation , [ fnLeaves , function ( oGrandTotal ) { var oGrandTotalCopy ; if ( oAggregation [ "grandTotal like 1.84" ] ) { _AggregationHelper . removeUI5grand__ ( oGrandTotal ) ; } _AggregationHelper . setAnnotations ( oGrandTotal , true , true , 0 , _AggregationHelper . getAllProperties ( oAggregation ) ) ; if ( oAggregation . grandTotalAtBottomOnly === false ) { oGrandTotalCopy = Object . assign ( { } , oGrandTotal , { "@$ui5.node.isExpanded" : undefined } ) ; _Helper . setPrivateAnnotation ( oGrandTotal , "copy" , oGrandTotalCopy ) ; _Helper . setPrivateAnnotation ( oGrandTotalCopy , "predicate" , "($isTotal=true)" ) ; } _Helper . setPrivateAnnotation ( oGrandTotal , "predicate" , "()" ) ; resolve ( oGrandTotal ) ; } , fnCount ] ) ; } ) ; } else if ( fnLeaves ) { _ConcatHelper . enhanceCache ( that . oFirstLevel , oAggregation , [ fnLeaves , fnCount ] ) ; } }
Creates a cache for data aggregation that performs requests using the given requestor.
Creates a cache for data aggregation that performs requests using the given requestor .
// no specific handling needed for "UI5__count" here // required for _Cache#drillDown (see _Cache.from$skip) // do this after #getDownloadUrl // Note: count is of type Edm.Int64, represented as a string in OData responses; // $count should be a number and the loss of precision is acceptable // rename measures // Note: make shallow copy *before* there are private annotations! // treat copy as a leaf