camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1163150 - in /camel/trunk/components/camel-jdbc/src: main/java/org/apache/camel/component/jdbc/JdbcProducer.java test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java
Date Tue, 30 Aug 2011 09:17:10 GMT
Author: davsclaus
Date: Tue Aug 30 09:17:10 2011
New Revision: 1163150

URL: http://svn.apache.org/viewvc?rev=1163150&view=rev
Log:
CAMEL-4350: camel-jdbc should use a linked map so the data is in order according to the ResultSet.
Thanks to Mathieu for the patch.

Modified:
    camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
    camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java

Modified: camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java?rev=1163150&r1=1163149&r2=1163150&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
(original)
+++ camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
Tue Aug 30 09:17:10 2011
@@ -22,7 +22,7 @@ import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import javax.sql.DataSource;
@@ -194,7 +194,7 @@ public class JdbcProducer extends Defaul
         List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
         int rowNumber = 0;
         while (rs.next() && (readSize == 0 || rowNumber < readSize)) {
-            Map<String, Object> row = new HashMap<String, Object>();
+            Map<String, Object> row = new LinkedHashMap<String, Object>();
             for (int i = 0; i < count; i++) {
                 int columnNumber = i + 1;
                 // use column label to get the name as it also handled SQL SELECT aliases

Modified: camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java?rev=1163150&r1=1163149&r2=1163150&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java
(original)
+++ camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java
Tue Aug 30 09:17:10 2011
@@ -32,6 +32,10 @@ import org.springframework.jdbc.core.Jdb
 import org.springframework.jdbc.datasource.DriverManagerDataSource;
 
 /**
+ * Is used as base class for testing the jdbc component.
+ * <p><b>Don't</b> add new test methods; it's likely to break the sub-classes.
+ * <p>Sub-classes should override {@link #testJdbcRoutes()} unless they create routes
that
+ * are semantically equivalent to what this class creates.
  * @version 
  */
 public class JdbcRouteTest extends CamelTestSupport {



Mime
View raw message