/** * returns the final alias for this projection item (the explicit alias, if defined, or the default alias) * * @return the final alias for this projection item */ public String getProjectionAliasAsString() { return getProjectionAlias().getStringValue(); }
/** * INTERNAL USE ONLY this has to be invoked ONLY if the item is aggregate!!! * * @param aggregateSplit */ public OProjectionItem splitForAggregation(AggregateProjectionSplit aggregateSplit, OCommandContext ctx) { if (isAggregate()) { OProjectionItem result = new OProjectionItem(-1); result.alias = getProjectionAlias(); result.expression = expression.splitForAggregation(aggregateSplit, ctx); result.nestedProjection = nestedProjection; return result; } else { return this; } }
String alias = proj.getProjectionAlias().getStringValue(); if (proj.isAggregate()) { AggregationContext aggrCtx = preAggr.getProperty(alias);
isSplitted = true; OProjectionItem post = item.splitForAggregation(result, ctx); OIdentifier postAlias = item.getProjectionAlias(); postAlias = new OIdentifier(postAlias, true); post.setAlias(postAlias); aggItem.setExpression(new OExpression(item.getProjectionAlias())); aggregate.getItems().add(aggItem); postAggregate.getItems().add(aggItem);