Package org.teiid.metadata

Examples of org.teiid.metadata.AbstractMetadataRecord


    }

    public Object getGroupIDForElementID(final Object elementID) throws TeiidComponentException, QueryMetadataException {
        if(elementID instanceof Column) {
            Column columnRecord = (Column) elementID;
            AbstractMetadataRecord parent = columnRecord.getParent();
            if (parent instanceof Table) {
              return parent;
            }
        }
        throw createInvalidRecordTypeException(elementID);
View Full Code Here


        }
    }

    public Properties getExtensionProperties(final Object metadataID) throws TeiidComponentException, QueryMetadataException {
        ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
        AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) metadataID;
        Map<String, String> result = metadataRecord.getProperties();
        if (result == null) {
          return EMPTY_PROPS;
        }
        Properties p = new Properties();
        p.putAll(result);
View Full Code Here

      Element typeElement = (Element) sObject.getElementsByTagName(SF_TYPE).item(0);
      String sObjectName = typeElement.getFirstChild().getNodeValue();
      Object[] row = new Object[visitor.getSelectSymbolCount()];
      for (int j = 0; j < visitor.getSelectSymbolCount(); j++) {
        Column element = visitor.getSelectSymbolMetadata(j);
        AbstractMetadataRecord parent = element.getParent();
        Table table;
        if(parent instanceof Table) {
          table = (Table)parent;
        } else {
          parent = parent.getParent();
          if(parent instanceof Table) {
            table = (Table)parent;
          } else {
            throw new TranslatorException("Could not resolve Table for column " + element.getName()); //$NON-NLS-1$
          }
View Full Code Here

              if (value.length() > MAX_VALUE_LENGTH) {
                throw new TeiidProcessingException(QueryPlugin.Util.getString("DataTierManagerImpl.max_value_length", MAX_VALUE_LENGTH)); //$NON-NLS-1$
              }
              strVal = ObjectConverterUtil.convertToString(value.getCharacterStream());
            }
            AbstractMetadataRecord target = getByUuid(metadata, uuid);
            if (target == null) {
              throw new TeiidProcessingException(QueryPlugin.Util.getString("DataTierManagerImpl.unknown_uuid", uuid)); //$NON-NLS-1$
            }
            if (this.metadataRepository != null) {
              this.metadataRepository.setProperty(vdbName, vdbVersion, target, key, strVal);
            }
            result = target.setProperty(key, strVal);
            if (eventDistributor != null) {
              eventDistributor.setProperty(vdbName, vdbVersion, uuid, key, strVal);
            }
            if (result == null) {
              rows.add(Arrays.asList((Clob)null));
View Full Code Here

      Call procedure, ExecutionContext executionContext,
      RuntimeMetadata metadata, Object connection) throws TranslatorException {
    Properties props = new Properties();
    props.setProperty("customBehaviour", "SkipExecute");//$NON-NLS-1$ //$NON-NLS-2$
 
        AbstractMetadataRecord metaObject = procedure.getMetadataObject();
       
        TestCase.assertEquals("AnyModel.ProcedureB",procedure.getProcedureName()); //$NON-NLS-1$
        TestCase.assertEquals("PROC", metaObject.getNameInSource()); //$NON-NLS-1$
        TestCase.assertEquals(props, metaObject.getProperties());
        ProcedureExecution exec = Mockito.mock(ProcedureExecution.class);
        Mockito.stub(exec.next()).toReturn(null);
        return exec;
  }
View Full Code Here

      QueryExpression query, ExecutionContext executionContext,
      RuntimeMetadata metadata, Object connection) throws TranslatorException {
    Properties groupProps = new Properties();
    groupProps.setProperty("customName", "CustomTableA");//$NON-NLS-1$ //$NON-NLS-2$
    NamedTable group = (NamedTable)query.getProjectedQuery().getFrom().get(0);     
    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();
View Full Code Here

  private static List<List<String>> initExternalList(List<List<String>> externalNames, Set<? extends Object> accessed) {
    if (externalNames == null) {
      externalNames = new ArrayList<List<String>>(accessed.size());
      for (Object object : accessed) {
        if (object instanceof AbstractMetadataRecord) {
          AbstractMetadataRecord t = (AbstractMetadataRecord)object;
          externalNames.add(Arrays.asList(t.getParent().getName(), t.getName()));
        } else if (object instanceof TempMetadataID) {
          TempMetadataID t = (TempMetadataID)object;
          externalNames.add(Arrays.asList(t.getID()));
        }
      }
    }
    return externalNames;
  }
View Full Code Here

TOP

Related Classes of org.teiid.metadata.AbstractMetadataRecord

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.