camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r607743 - /activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java
Date Mon, 31 Dec 2007 15:57:01 GMT
Author: jstrachan
Date: Mon Dec 31 07:57:00 2007
New Revision: 607743

URL: http://svn.apache.org/viewvc?rev=607743&view=rev
Log:
added a patch for https://issues.apache.org/activemq/browse/CAMEL-282

Modified:
    activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java

Modified: activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java?rev=607743&r1=607742&r2=607743&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java
(original)
+++ activemq/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java
Mon Dec 31 07:57:00 2007
@@ -17,8 +17,12 @@
  */
 package org.apache.camel.component.ibatis;
 
+import java.util.Iterator;
+
 import com.ibatis.sqlmap.client.SqlMapClient;
 import org.apache.camel.Exchange;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.converter.ObjectConverter;
 import org.apache.camel.impl.DefaultProducer;
 
 /**
@@ -45,7 +49,12 @@
         }
         else {
             String operation = getOperationName(exchange);
-            endpoint.getSqlClient().insert(operation, body);
+
+            // lets handle arrays or collections of objects
+            Iterator iter = ObjectConverter.iterator(body);
+            while (iter.hasNext()) {
+                endpoint.getSqlClient().insert(operation, iter.next());
+            }
         }
     }
 



Mime
View raw message