for (ColumnValues cols : columnValues) {
cols.getColumns().get(i).setName(translation.getFromColumns()[i]);
}
}
EntityTranslation fromTranslation = edge.getFrom().getTranslation();
//now translate the foreign keys into primary keys
//but first check if we even need to do it by comparing the column names
boolean columnsDiffer = false;
Set<String> pkColumns = new HashSet<String>(Arrays.asList(fromTranslation.getPkColumns()));
for(String col : translation.getFromColumns()) {
if (!pkColumns.contains(col)) {
columnsDiffer = true;
break;
}
}
if (columnsDiffer) {
columnValues = getValuesFromTable(connection, fromTranslation.getTableName(),
fromTranslation.getPkColumns(), removeValuesWithNullColumn(columnValues));
}
return removeValuesWithNullColumn(columnValues);
} else {
//only bother with one-to-many relationships. A many-to-many