use of org.teiid.infinispan.api.TableWireFormat in project teiid by teiid.
the class MarshallerBuilder method getWireMap.
public static TreeMap<Integer, TableWireFormat> getWireMap(Table parentTbl, RuntimeMetadata metadata) throws TranslatorException {
TreeMap<Integer, TableWireFormat> wireMap = buildWireMap(parentTbl, false, metadata);
Schema schema = parentTbl.getParent();
for (Table table : schema.getTables().values()) {
if (table.equals(parentTbl)) {
continue;
}
String mergeName = ProtobufMetadataProcessor.getMerge(table);
if (mergeName != null && mergeName.equals(parentTbl.getFullName())) {
// one 2 many relation
int parentTag = ProtobufMetadataProcessor.getParentTag(table);
String childName = ProtobufMetadataProcessor.getMessageName(table);
TableWireFormat child = new TableWireFormat(childName, parentTag);
wireMap.put(child.getReadTag(), child);
TreeMap<Integer, TableWireFormat> childWireMap = buildWireMap(table, true, metadata);
for (TableWireFormat twf : childWireMap.values()) {
child.addNested(twf);
}
}
}
return wireMap;
}
Aggregations