DbEntity source = getEntity();
DbEntity dest = (DbEntity) rel.getTargetEntity();
// only use the first. See adapter
// TODO: can we be sure this is the first and same as used by the adapter?
DbJoin join = rel.getJoins().get(0);
// see comment in adapter for why source and dest is switched around..
buf.append(" source_table = '");
buf.append(dest.getFullyQualifiedName());
buf.append("'");
buf.append(" and source_column = '");
buf.append(join.getTargetName());
buf.append("'");
buf.append(" and dest_table = '");
buf.append(source.getFullyQualifiedName());
buf.append("'");
buf.append(" and dest_column = '");
buf.append(join.getSourceName());
buf.append("'");
return Collections.singletonList(buf.toString());
}