private Collection<Var> migrateColumns(SQLTable table,ResultSet row,Var instance) throws SQLException {
  String tableType=table.getEntityType();
  Map<String,ResourceType.DataType> columns=table.getColumns();
  Map<String,String> foreign=table.getForeignKeyColumns();
  ResultSetMetaData metadata=row.getMetaData();
  List<Var> vars=new ArrayList<>();
  for (int i=1; i <= metadata.getColumnCount(); i++) {
    String columnName=metadata.getColumnName(i);
    Object columnValue=row.getObject(columnName);
    ResourceType.DataType dataType=columns.get(columnName);
    String foreignKey=foreign.get(columnName);
    if (foreignKey != null) {
      vars.addAll(migrateColumnValueAsRelation(instance,columnName,foreignKey,columnValue));
    }
 else {
      vars.addAll(migrateColumnValueAsResource(instance,columnName,cast(dataType,columnName,row),tableType));
    }
  }
  return vars;
}

private Collection < Var > migrateColumns ( SQLTable table , ResultSet row , Var instance ) throws SQLException { String tableType = table . getEntityType ( ) ; Map < String , ResourceType . DataType > columns = table . getColumns ( ) ; Map < String , String > foreign = table . getForeignKeyColumns ( ) ; ResultSetMetaData metadata = row . getMetaData ( ) ; List < Var > vars = new ArrayList < > ( ) ; for ( int i = 1 ; i <= metadata . getColumnCount ( ) ; i ++ ) { String columnName = metadata . getColumnName ( i ) ; Object columnValue = row . getObject ( columnName ) ; ResourceType . DataType dataType = columns . get ( columnName ) ; String foreignKey = foreign . get ( columnName ) ; if ( foreignKey != null ) { vars . addAll ( migrateColumnValueAsRelation ( instance , columnName , foreignKey , columnValue ) ) ; } else { vars . addAll ( migrateColumnValueAsResource ( instance , columnName , cast ( dataType , columnName , row ) , tableType ) ) ; } } return vars ; }
loop through each of the columns in the row , migrating each as a resource or relation .
