}
protected abstract DatabaseObject translate(DatabaseObject original, BeginEndQuote quotes);
private void processRelationships() {
DbTranRelations original = dbStruct.getRelations();
List<Relation> copiedJoins = Lists.newArrayList();
for (Relation join : original.getRelations()) {
DatabaseObject parent = translatedObjects.get(join.getParentName());
DatabaseObject child = translatedObjects.get(join.getChildName());
if (parent != null && child != null) {
DatabaseColumn parentField = parent.findColumn(join.getParentField());
DatabaseColumn childField = child.findColumn(join.getChildField());
if (parentField != null && childField != null) {
TableRelationship tr = new TableRelationship(parent, child);
tr.setRelationshipNature(join.getCardinality());
FieldRelationship fr = new FieldRelationship(parentField, childField);
copiedJoins.add(new Relation(tr, fr));
}
}
}
DbTranRelations copy = new DbTranRelations();
for (Relation r : copiedJoins) {
copy.addRelation(r);
}
dbStruct.setRelations(copy);
}