public Class<?> getType() { if (this.isPositional() && this.expression == null) { return type; } return expression.getType(); }
public Class<?> getType() { if (this.isPositional() && this.expression == null) { return type; } return expression.getType(); }
public Class<?> getType() { if (this.isPositional() && this.expression == null) { return type; } return expression.getType(); }
@Override public Expression replaceExpression(Expression element) { if (!(element instanceof Reference)) { return element; } Reference ref = (Reference)element; if (!ref.isPositional()) { return ref; } return elements.get(ref.getIndex()).clone(); } };
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
/** * Define hash code to be that of the underlying object to make it stable. * @return Hash code, based on value */ public int hashCode() { if (this.isPositional()) { return getIndex(); } return this.expression.hashCode(); }
@Override public void visit( Reference obj ) { if (!obj.isPositional() && obj.getExpression() != null) { visitNode(obj.getExpression()); } else { append("?"); //$NON-NLS-1$ } }
@Override public void visit( Reference obj ) { if (!obj.isPositional() && obj.getExpression() != null) { visitNode(obj.getExpression()); } else { append("?"); //$NON-NLS-1$ } }
@Override public void visit( Reference obj ) { if (!obj.isPositional() && obj.getExpression() != null) { visitNode(obj.getExpression()); } else { append("?"); //$NON-NLS-1$ } }
/** * We assume the non-push down for correlation variables, * then make specific checks when correlated variables are allowed. */ public void visit(Reference obj) { hasCorrelatedReferences |= obj.isCorrelated(); if (obj.isPositional()) { setDeterminismLevel(Determinism.COMMAND_DETERMINISTIC); } else if (modelId != null) { //for pushdown commands correlated references mean we're non-deterministic setDeterminismLevel(Determinism.NONDETERMINISTIC); } evaluationNotPossible(EvaluationLevel.PROCESSING); }
/** * We assume the non-push down for correlation variables, * then make specific checks when correlated variables are allowed. */ public void visit(Reference obj) { hasCorrelatedReferences |= obj.isCorrelated(); if (obj.isPositional()) { setDeterminismLevel(Determinism.COMMAND_DETERMINISTIC); } else if (modelId != null) { //for pushdown commands correlated references mean we're non-deterministic setDeterminismLevel(Determinism.NONDETERMINISTIC); } evaluationNotPossible(EvaluationLevel.PROCESSING); }
/** * We assume the non-push down for correlation variables, * then make specific checks when correlated variables are allowed. */ public void visit(Reference obj) { hasCorrelatedReferences |= obj.isCorrelated(); if (obj.isPositional()) { setDeterminismLevel(Determinism.COMMAND_DETERMINISTIC); } else if (modelId != null) { //for pushdown commands correlated references mean we're non-deterministic setDeterminismLevel(Determinism.NONDETERMINISTIC); } evaluationNotPossible(EvaluationLevel.PROCESSING); }
public boolean isCorrelated() { if (this.isPositional()) { return false; } //metadata hack if (this.expression.getGroupSymbol() == null || !(this.expression.getGroupSymbol().getMetadataID() instanceof TempMetadataID)) { return true; } TempMetadataID tid = (TempMetadataID)this.expression.getGroupSymbol().getMetadataID(); return !tid.isScalarGroup(); }
public boolean isCorrelated() { if (this.isPositional()) { return false; } //metadata hack if (this.expression.getGroupSymbol() == null || !(this.expression.getGroupSymbol().getMetadataID() instanceof TempMetadataID)) { return true; } TempMetadataID tid = (TempMetadataID)this.expression.getGroupSymbol().getMetadataID(); return !tid.isScalarGroup(); }
public boolean isCorrelated() { if (this.isPositional()) { return false; } //metadata hack if (this.expression.getGroupSymbol() == null || !(this.expression.getGroupSymbol().getMetadataID() instanceof TempMetadataID)) { return true; } TempMetadataID tid = (TempMetadataID)this.expression.getGroupSymbol().getMetadataID(); return !tid.isScalarGroup(); }
public static void setParameterValues(List<?> values, Command command, CommandContext context) { VariableContext vc = new VariableContext(); Iterator<?> valIter = values.iterator(); for (Reference ref : ReferenceCollectorVisitor.getReferences(command)) { if (!ref.isPositional()) { continue; } vc.setGlobalValue(ref.getContextSymbol(), valIter.next()); //$NON-NLS-1$ } context.setVariableContext(vc); }
/** * Utility to set the type of an expression if it is a Reference and has a null type. * @param expression the expression to test * @param targetType the target type, if the expression's type is null. * @throws QueryResolverException if unable to set the reference type to the target type. */ public static void setDesiredType(Expression expression, Class<?> targetType, LanguageObject surroundingExpression) throws QueryResolverException { if (expression instanceof Reference) { Reference ref = (Reference)expression; if (ref.isPositional() && ref.getType() == null) { if (targetType == null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30083, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30083, surroundingExpression)); } ref.setType(targetType); } } else if (expression instanceof Function) { Function f = (Function)expression; if (f.getType() == null) { f.setType(targetType); } } }
/** * Utility to set the type of an expression if it is a Reference and has a null type. * @param expression the expression to test * @param targetType the target type, if the expression's type is null. * @throws QueryResolverException if unable to set the reference type to the target type. */ public static void setDesiredType(Expression expression, Class<?> targetType, LanguageObject surroundingExpression) throws QueryResolverException { if (expression instanceof Reference) { Reference ref = (Reference)expression; if (ref.isPositional() && ref.getType() == null) { if (targetType == null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30083, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30083, surroundingExpression)); } ref.setType(targetType); } } else if (expression instanceof Function) { Function f = (Function)expression; if (f.getType() == null) { f.setType(targetType); } } }
/** * Utility to set the type of an expression if it is a Reference and has a null type. * @param expression the expression to test * @param targetType the target type, if the expression's type is null. * @throws QueryResolverException if unable to set the reference type to the target type. */ public static void setDesiredType(Expression expression, Class<?> targetType, LanguageObject surroundingExpression) throws QueryResolverException { if (expression instanceof Reference) { Reference ref = (Reference)expression; if (ref.isPositional() && ref.getType() == null) { if (targetType == null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30083, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30083, surroundingExpression)); } ref.setType(targetType); } } else if (expression instanceof Function) { Function f = (Function)expression; if (f.getType() == null) { f.setType(targetType); } } }