private static OProjectionItem projectionFromAlias(OIdentifier oIdentifier) { OProjectionItem result = new OProjectionItem(-1); result.setExpression(new OExpression(oIdentifier)); return result; }
public OProjectionItem getExpandContent() { OProjectionItem result = new OProjectionItem(-1); result.setExpression(expression.getExpandContent()); return result; }
public void deserialize(OResult fromResult) { distinct = fromResult.getProperty("distinct"); if (fromResult.getProperty("items") != null) { items = new ArrayList<>(); List<OResult> ser = fromResult.getProperty("items"); for (OResult x : ser) { OProjectionItem item = new OProjectionItem(-1); item.deserialize(x); items.add(item); } } }
public OProjectionItem copy() { OProjectionItem result = new OProjectionItem(-1); result.all = all; result.alias = alias == null ? null : alias.copy(); result.expression = expression == null ? null : expression.copy(); result.nestedProjection = nestedProjection == null ? null : nestedProjection.copy(); result.aggregate = aggregate; return result; }
/** * 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; } }
private OProjectionItem createProjection(OFunctionCall newFunct, OIdentifier alias) { OLevelZeroIdentifier l0 = new OLevelZeroIdentifier(-1); l0.functionCall = newFunct; OBaseIdentifier l1 = new OBaseIdentifier(-1); l1.levelZero = l0; OBaseExpression l2 = new OBaseExpression(-1); l2.identifier = l1; OExpression l3 = new OExpression(-1); l3.mathExpression = l2; OProjectionItem item = new OProjectionItem(-1); item.alias = alias; item.expression = l3; return item; }
private void addReturnStep(OSelectExecutionPlan result, OCommandContext context, boolean profilingEnabled) { if (returnElements) { result.chain(new ReturnMatchElementsStep(context, profilingEnabled)); } else if (returnPaths) { result.chain(new ReturnMatchPathsStep(context, profilingEnabled)); } else if (returnPatterns) { result.chain(new ReturnMatchPatternsStep(context, profilingEnabled)); } else if (returnPathElements) { result.chain(new ReturnMatchPathElementsStep(context, profilingEnabled)); } else { OProjection projection = new OProjection(-1); projection.setItems(new ArrayList<>()); for (int i = 0; i < returnAliases.size(); i++) { OProjectionItem item = new OProjectionItem(-1); item.setExpression(returnItems.get(i)); item.setAlias(returnAliases.get(i)); item.setNestedProjection(returnNestedProjections.get(i)); projection.getItems().add(item); } result.chain(new ProjectionCalculationStep(projection, context, profilingEnabled)); } }
/** * for backward compatibility, translate "distinct(foo)" to "DISTINCT foo". This method modifies the projection itself. * * @param projection the projection */ protected static OProjection translateDistinct(OProjection projection) { if (projection != null && projection.getItems().size() == 1) { if (isDistinct(projection.getItems().get(0))) { projection = projection.copy(); OProjectionItem item = projection.getItems().get(0); OFunctionCall function = ((OBaseExpression) item.getExpression().getMathExpression()).getIdentifier().getLevelZero() .getFunctionCall(); OExpression exp = function.getParams().get(0); OProjectionItem resultItem = new OProjectionItem(-1); resultItem.setAlias(item.getAlias()); resultItem.setExpression(exp.copy()); OProjection result = new OProjection(-1); result.setItems(new ArrayList<>()); result.setDistinct(true); result.getItems().add(resultItem); return result; } } return projection; }
OProjectionItem paramItem = new OProjectionItem(-1); paramItem.alias = nextAlias; paramItem.expression = param;
List<OProjectionItem> items = new ArrayList<>(); for (int i = 0; i < this.returnItems.size(); i++) { OProjectionItem item = new OProjectionItem(returnItems.get(i), this.returnAliases.get(i), returnNestedProjections.get(i)); items.add(item);
preAggregate.getItems().add(item); OProjectionItem aggItem = new OProjectionItem(-1); aggItem.setExpression(new OExpression(item.getProjectionAlias())); aggregate.getItems().add(aggItem);
OProjectionItem newItem = new OProjectionItem(-1); newItem.setExpression(exp); OIdentifier groupByAlias = new OIdentifier("_$$$GROUP_BY_ALIAS$$$_" + (i++));
for (OOrderByItem item : orderBy.getItems()) { if (!allAliases.contains(item.getAlias())) { OProjectionItem newProj = new OProjectionItem(-1); if (item.getAlias() != null) { newProj.setExpression(new OExpression(new OIdentifier(item.getAlias()), item.getModifier()));
final public OProjectionItem ProjectionItem() throws ParseException { OProjectionItem jjtn000 = new OProjectionItem(JJTPROJECTIONITEM); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);