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;
}