Skip to content

Commit

Permalink
sort tables
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Apr 19, 2012
1 parent dbb2cc6 commit 477ec27
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -28,13 +28,15 @@
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;

import javax.sql.DataSource;

import org.jumpmind.db.io.DatabaseIO;
import org.jumpmind.db.model.Column;
import org.jumpmind.db.model.Database;
import org.jumpmind.db.model.SortByForeignKeyComparator;
import org.jumpmind.db.model.Table;
import org.jumpmind.db.platform.DatabasePlatformSettings;
import org.jumpmind.db.platform.IDatabasePlatform;
Expand Down Expand Up @@ -138,6 +140,8 @@ public void exportTables(OutputStream output, Table[] tables) throws IOException
public void exportTables(OutputStream output, Table[] tables, String sql) throws IOException {
final Writer writer = new OutputStreamWriter(output);
final CsvWriter csvWriter = new CsvWriter(writer, ',');

Arrays.sort(tables, new SortByForeignKeyComparator());

IDatabasePlatform target = new OracleDatabasePlatform(null, new DatabasePlatformSettings());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Expand Down

0 comments on commit 477ec27

Please sign in to comment.