Package org.teiid.query.metadata

Examples of org.teiid.query.metadata.GroupInfo


   
  static GroupInfo getGroupInfo(GroupSymbol group,
      QueryMetadataInterface metadata)
      throws TeiidComponentException, QueryMetadataException {
    String key = GroupInfo.CACHE_PREFIX + group.getCanonicalName();
    GroupInfo groupInfo = (GroupInfo)metadata.getFromMetadataCache(group.getMetadataID(), key);
     
        if (groupInfo == null) {
          group = group.clone();
            // get all elements from the metadata
            List elementIDs = metadata.getElementIDsInGroupID(group.getMetadataID());

        LinkedHashMap<Object, ElementSymbol> symbols = new LinkedHashMap<Object, ElementSymbol>(elementIDs.size());
           
            for (Object elementID : elementIDs) {
              String elementName = metadata.getName(elementID);
                // Form an element symbol from the ID
                ElementSymbol element = new ElementSymbol(elementName, DataTypeManager.getCanonicalString(StringUtil.toUpperCase(elementName)), group);
                element.setMetadataID(elementID);
                element.setType( DataTypeManager.getDataTypeClass(metadata.getElementType(element.getMetadataID())) );

                symbols.put(elementID, element);
            }
            groupInfo = new GroupInfo(symbols);
            metadata.addToMetadataCache(group.getMetadataID(), key, groupInfo);
        }
    return groupInfo;
  }
View Full Code Here


            if (accessPatterns == null){
                accessPatterns = new ArrayList();
            }
            while (j.hasNext()) {
              List elements = metadata.getElementIDsInAccessPattern(j.next());
              GroupInfo groupInfo = getGroupInfo(group, metadata);
              List result = new ArrayList(elements.size());
              for (Iterator iterator = elements.iterator(); iterator.hasNext();) {
              Object id = iterator.next();
              ElementSymbol symbol = groupInfo.getSymbol(id);
              assert symbol != null;
              result.add(symbol);
            }
              if (flatten) {
                accessPatterns.addAll(result);
View Full Code Here

    private void resolveAgainstGroups(String elementShortName,
                                      Collection<GroupSymbol> matchedGroups, LinkedList<ElementMatch> matches) throws QueryMetadataException,
                                                         TeiidComponentException {
      for (GroupSymbol group : matchedGroups) {
            GroupInfo groupInfo = ResolverUtil.getGroupInfo(group, metadata);
           
            ElementSymbol result = groupInfo.getSymbol(elementShortName);
            if (result != null) {
              matches.add(new ElementMatch(result, group));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.teiid.query.metadata.GroupInfo

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.