db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r289462 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java
Date Fri, 16 Sep 2005 09:48:55 GMT
Author: tomdz
Date: Fri Sep 16 02:48:52 2005
New Revision: 289462

URL: http://svn.apache.org/viewcvs?rev=289462&view=rev
Log:
Fixed a bug in the identity creation during the processing of data xml files

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java?rev=289462&r1=289461&r2=289462&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java Fri Sep 16 02:48:52
2005
@@ -238,7 +238,7 @@
             }
             else
             {
-                _log.debug("Exception while inserting a bean into the database", ex);
+                _log.warn("Exception while inserting a bean into the database", ex);
             }
         }
         if (_processedIdentities.containsKey(table.getName()))
@@ -333,13 +333,12 @@
      */
     private Identity buildIdentityFromPKs(Table table, DynaBean bean)
     {
-        Identity identity = new Identity(table.getName());
+        Identity identity  = new Identity(table.getName());
+        Column[] pkColumns = table.getPrimaryKeyColumns();
 
-        for (int idx = 0; idx < table.getColumnCount(); idx++)
+        for (int idx = 0; idx < pkColumns.length; idx++)
         {
-            Column column = table.getColumn(idx);
-
-            identity.setIdentityColumn(column.getName(), bean.get(column.getName()));
+            identity.setIdentityColumn(pkColumns[idx].getName(), bean.get(pkColumns[idx].getName()));
         }
         return identity;
     }



Mime
View raw message