// we need a temporary list as there is no warranty about the set order...
List fkTables = new ArrayList( fkEdges.size() );
Iterator iterator = fkEdges.iterator();
StringBuffer colsBuffer = new StringBuffer();
while ( iterator.hasNext() ) {
ForeignKeyRelationshipEdge edge = (ForeignKeyRelationshipEdge) iterator.next();
fkTables.add( edge.getTo() );
colsBuffer.append( edge.getFKColumn() );
if ( iterator.hasNext() ) {
colsBuffer.append( ", " );
}
}
// NOTE: make sure the query below is compatible standard SQL