db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r380978 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/db2/Db2ModelReader.java
Date Sat, 25 Feb 2006 20:16:19 GMT
Author: tomdz
Date: Sat Feb 25 12:16:16 2006
New Revision: 380978

URL: http://svn.apache.org/viewcvs?rev=380978&view=rev
Log:
Enhanced pk-index detection

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

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/db2/Db2ModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/db2/Db2ModelReader.java?rev=380978&r1=380977&r2=380978&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/db2/Db2ModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/db2/Db2ModelReader.java Sat Feb
25 12:16:16 2006
@@ -176,11 +176,22 @@
     		try
     		{
     			Long.parseLong(index.getName().substring(3));
-    			return true;
     		}
     		catch (NumberFormatException ex)
-    		{}
-    		
+    		{
+    			return false;
+    		}
+
+    		Column[] pks = table.getPrimaryKeyColumns();
+
+    		for (int idx = 0; idx < pks.length; idx++)
+    		{
+    			if (!index.getColumn(idx).getName().equals(pks[idx].getName()))
+    			{
+    				return false;
+    			}
+    		}
+    		return true;
     	}
 		return false;
     }



Mime
View raw message