db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r421157 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
Date Wed, 12 Jul 2006 06:11:47 GMT
Author: tomdz
Date: Tue Jul 11 23:11:47 2006
New Revision: 421157

URL: http://svn.apache.org/viewvc?rev=421157&view=rev
Log:
The base model reader now sorts the tables read from the database alphabetically

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java?rev=421157&r1=421156&r2=421157&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java Tue Jul 11
23:11:47 2006
@@ -23,8 +23,11 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.sql.Types;
+import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -509,6 +512,15 @@
                     tables.add(table);
                 }
             }
+
+            final Collator collator = Collator.getInstance();
+            
+            Collections.sort(tables, new Comparator() {
+                public int compare(Object obj1, Object obj2)
+                {
+                    return collator.compare(((Table)obj1).getName().toUpperCase(), ((Table)obj2).getName().toUpperCase());
+                }
+            });
             return tables;
         }
         finally



Mime
View raw message