Package org.teiid.language

Examples of org.teiid.language.ColumnReference


    // specifies, right now this is the same size as the updateList.
    // When we start filtering out DN changes (which would need to
    // be performed separately using Context.rename()), we will
    // need to account for this in determining this list size.
    ModificationItem[] updateMods = new ModificationItem[updateList.size()];
    ColumnReference leftElement;
    Expression rightExpr;
    String nameLeftElement;
    Object valueRightExpr;
    // iterate through the supplied list of updates (each of
    // which is an ICompareCriteria with an IElement on the left
View Full Code Here


    }

    public Column getElement(String groupName, String elementName, TranslationUtility transUtil) throws Exception {
        Select query = (Select) transUtil.parseCommand("SELECT " + elementName + " FROM " + groupName); //$NON-NLS-1$ //$NON-NLS-2$
        DerivedColumn symbol = query.getDerivedColumns().get(0);
        ColumnReference element = (ColumnReference) symbol.getExpression();
        return element.getMetadataObject();
    }
View Full Code Here

           
            SortSpecification orderByItem = null;                               
            if(items.get(i).isUnrelated() || (!set && symbol instanceof ElementSymbol)){
              orderByItem = new SortSpecification(direction, translate(symbol));                               
            } else {
              orderByItem = new SortSpecification(direction, new ColumnReference(null, symbol.getOutputName(), null, symbol.getType()));
            }
            orderByItem.setNullOrdering(items.get(i).getNullOrdering());
            translatedItems.add(orderByItem);
        }
        return new org.teiid.language.OrderBy(translatedItems);
View Full Code Here

    org.teiid.language.Expression translate(AliasSymbol symbol) {
        return translate(symbol.getSymbol());
    }

    ColumnReference translate(ElementSymbol symbol) {
        ColumnReference element = new ColumnReference(translate(symbol.getGroupSymbol()), symbol.getOutputName(), null, symbol.getType());
        if (element.getTable().getMetadataObject() == null) {
            return element;
        }

        Object mid = symbol.getMetadataID();
       
        if(! (mid instanceof TempMetadataID)) {
            element.setMetadataObject(metadataFactory.getElement(mid));
        }
        return element;
    }
View Full Code Here

    // ################ TEST ELEMENT METADATAID ######################
   
    public Column getElementID(String groupName, String elementName, TranslationUtility transUtil) {
        Select query = (Select) transUtil.parseCommand("SELECT " + elementName + " FROM " + groupName); //$NON-NLS-1$ //$NON-NLS-2$
        DerivedColumn symbol = query.getDerivedColumns().get(0);
        ColumnReference element = (ColumnReference) symbol.getExpression();
        return element.getMetadataObject();
    }
View Full Code Here

            }
            String sequenceGroupName = sequence.substring(0, delimiterIndex);
            String sequenceElementName = sequence.substring(delimiterIndex + 1);
               
            NamedTable sequenceGroup = this.getLanguageFactory().createNamedTable(sequenceGroupName, null, null);
            ColumnReference sequenceElement = this.getLanguageFactory().createColumnReference(sequenceElementName, sequenceGroup, null, element.getJavaType());
            insert.getColumns().add(index, this.getLanguageFactory().createColumnReference(element.getName(), insert.getTable(), element, element.getJavaType()));
            values.getValues().add(index, sequenceElement);
    }
    }
View Full Code Here

    String[] Ids = getIDs(((Update)command).getWhere(), visitor);

    if (null != Ids && Ids.length > 0) {
      List<JAXBElement> elements = new ArrayList<JAXBElement>();
      for (SetClause clause : ((Update)command).getChanges()) {
        ColumnReference element = clause.getSymbol();
        Column column = element.getMetadataObject();
        String val = ((Literal) clause.getValue()).toString();
        JAXBElement messageElem = new JAXBElement(new QName(column.getNameInSource()), stringClazz, Util.stripQutes(val));
        elements.add(messageElem);
      }
View Full Code Here

    AbstractMetadataRecord groupMD = group.getMetadataObject();
    TestCase.assertEquals(groupProps, groupMD.getProperties());
   
   
    DerivedColumn symbl = query.getProjectedQuery().getDerivedColumns().get(0);
    ColumnReference element = (ColumnReference)symbl.getExpression();
    Column elementMD = element.getMetadataObject();

    Properties elementProps = new Properties();
    elementProps.setProperty("customPosition", "11");//$NON-NLS-1$ //$NON-NLS-2$
   
    TestCase.assertEquals(0, elementMD.getLength());
    TestCase.assertEquals("Foo", elementMD.getDefaultValue()); //$NON-NLS-1$
    TestCase.assertEquals("TrimNulls", elementMD.getFormat()); //$NON-NLS-1$
    TestCase.assertEquals(String.class, elementMD.getJavaType());
    TestCase.assertEquals(null, elementMD.getMaximumValue());
    TestCase.assertEquals(null, elementMD.getMinimumValue());
    TestCase.assertEquals("http://www.w3.org/2001/XMLSchema#anySimpleType", elementMD.getBaseTypeID()); //$NON-NLS-1$
    TestCase.assertEquals("http://www.w3.org/2001/XMLSchema#string", elementMD.getPrimitiveTypeID()); //$NON-NLS-1$
    TestCase.assertEquals("http://www.w3.org/2001/XMLSchema#string", elementMD.getDatatypeID()); //$NON-NLS-1$
    TestCase.assertEquals("COLUMN1", elementMD.getNameInSource()); //$NON-NLS-1$
    TestCase.assertEquals("STR", elementMD.getNativeType()); //$NON-NLS-1$
    TestCase.assertEquals(NullType.Nullable, elementMD.getNullType());
    TestCase.assertEquals(0, elementMD.getPosition());
    TestCase.assertEquals(0, elementMD.getPrecision());
    TestCase.assertEquals(0, elementMD.getScale());
    TestCase.assertEquals(SearchType.Searchable, elementMD.getSearchType());
    TestCase.assertEquals(false, elementMD.isAutoIncremented());
    TestCase.assertEquals(true, elementMD.isCaseSensitive());
    TestCase.assertEquals(elementProps, elementMD.getProperties());
   
   
    DerivedColumn symbl2 = query.getProjectedQuery().getDerivedColumns().get(1);
    ColumnReference element2 = (ColumnReference)symbl2.getExpression();
    Column elementMD2 = element2.getMetadataObject();

    Properties elementProps2 = new Properties();
    elementProps2.setProperty("customPosition", "12");//$NON-NLS-1$ //$NON-NLS-2$
   
    TestCase.assertEquals(10, elementMD2.getLength());
View Full Code Here

TOP

Related Classes of org.teiid.language.ColumnReference

Copyright © 2018 www.massapicom. 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.