Examples of AliasSymbol


Examples of org.teiid.query.sql.symbol.AliasSymbol

    private AliasSymbol getMachingAlias(List elementsInGroup, ElementSymbol symbol) {
       
        for(Iterator i = elementsInGroup.iterator(); i.hasNext();) {
            final SingleElementSymbol element = (SingleElementSymbol)i.next();
            if (element instanceof AliasSymbol) {
                AliasSymbol alias = (AliasSymbol)element;
                if (alias.getSymbol().equals(symbol)) {
                    return alias;
                }
            }
        }
        return null;
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

          SingleElementSymbol actual = iter.next();
          if (!ses.getShortCanonicalName().equals(actual.getShortCanonicalName())) {
            if (ses instanceof AliasSymbol) {
              ((AliasSymbol)ses).setShortName(actual.getShortName());
            } else {
              ses = new AliasSymbol(actual.getShortName(), ses);
            }
          }
      select.addSymbol(ses);
    }
        query.setFrom(from);
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

                symbol = ((AliasSymbol)symbol).getSymbol();
                hasAlias = true;
            }
           
            if (((symbol instanceof ExpressionSymbol) && !hasAlias) || !name.equalsIgnoreCase(baseName)) {
                symbols.set(i, new AliasSymbol(name, symbol));
            }
        }
    }
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        if (!(ex instanceof SingleElementSymbol)) {
          selectSymbol = new ExpressionSymbol("expr", ex); //$NON-NLS-1$
        } else {
          selectSymbol = (SingleElementSymbol)ex;
        }
        selectSymbols.add(new AliasSymbol("s_" +i, selectSymbol)); //$NON-NLS-1$
        ex = new ElementSymbol("s_" +i); //$NON-NLS-1$
      }
      if (symbolMap != null) {
        clause.setSymbol(symbolMap.get(clause.getSymbol()));
      }
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

    int i = query.getSelect().getSymbols().size();
    List<Object> ids = metadata.getElementIDsInKey(pk);
    List<Criteria> pkCriteria = new ArrayList<Criteria>(ids.size());
    for (Object object : ids) {
      ElementSymbol es = new ElementSymbol(correlationName + ElementSymbol.SEPARATOR + metadata.getName(object));
      query.getSelect().addSymbol(new AliasSymbol("s_" +i, es)); //$NON-NLS-1$
      es = new ElementSymbol(group.getName() + ElementSymbol.SEPARATOR + metadata.getName(object));
      pkCriteria.add(new CompareCriteria(es, CompareCriteria.EQ, new ElementSymbol("X.s_" + i))); //$NON-NLS-1$
      i++;
    }
    return pkCriteria;
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        String elementName = tempName + SingleElementSymbol.SEPARATOR + symbol.getShortName();
       
        Object metadataID = null;
       
        if (symbol instanceof AliasSymbol) {
            AliasSymbol as = (AliasSymbol)symbol;
            symbol = as.getSymbol();
        }
       
        //the following allows for orginal metadata ids to be determined for proc inputs
        if (symbol instanceof ExpressionSymbol && !(symbol instanceof AggregateSymbol)) {
            Expression expr = ((ExpressionSymbol)symbol).getExpression();
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_FRAC_SECOND"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);

        Query query = new Query();
        query.setSelect(select);
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_SECOND"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);

        Query query = new Query();
        query.setSelect(select);
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_MINUTE"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);

        Query query = new Query();
        query.setSelect(select);
View Full Code Here

Examples of org.teiid.query.sql.symbol.AliasSymbol

        from.addGroup(g);

        Function f = new Function("timestampadd", new Expression[] { //$NON-NLS-1$
            new Constant("SQL_TSI_HOUR"), new Constant(new Integer(10)), new Constant("2003-05-01 10:20:30")}); //$NON-NLS-1$ //$NON-NLS-2$
        ExpressionSymbol es = new ExpressionSymbol("expr", f); //$NON-NLS-1$
        AliasSymbol as = new AliasSymbol("x", es); //$NON-NLS-1$
        Select select = new Select();
        select.addSymbol(as);

        Query query = new Query();
        query.setSelect(select);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.