ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/25] incubator-ignite git commit: # ignite-437: remove setObjectSmart(...)
Date Fri, 27 Mar 2015 09:28:09 GMT
# ignite-437: remove setObjectSmart(...)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0271114b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0271114b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0271114b

Branch: refs/heads/sprint-3
Commit: 0271114b6169b20c976116b7edcd43628b4b2137
Parents: c2d761a
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Fri Mar 20 19:03:28 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Fri Mar 20 19:03:28 2015 +0300

----------------------------------------------------------------------
 .../query/h2/sql/IgniteVsH2QueryTest.java       | 59 ++++++++------------
 1 file changed, 22 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0271114b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
index 8085b20..ce2b661 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
@@ -216,10 +216,10 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     private void insertInDb(Organization org) throws SQLException {
         try(PreparedStatement st = conn.prepareStatement(
             "insert into \"part\".ORGANIZATION (_key, _val, id, name) values(?, ?, ?, ?)"))
{
-            setObjectSmart(st, 1, org.id);
-            setObjectSmart(st, 2, org);
-            setObjectSmart(st, 3, org.id);
-            setObjectSmart(st, 4, org.name);
+            st.setObject(1, org.id);
+            st.setObject(2, org);
+            st.setObject(3, org.id);
+            st.setObject(4, org.name);
 
             st.executeUpdate();
         }
@@ -234,13 +234,13 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     private void insertInDb(Person p) throws SQLException {
         try(PreparedStatement st = conn.prepareStatement("insert into \"part\".PERSON " +
             "(_key, _val, id, firstName, lastName, orgId, salary) values(?, ?, ?, ?, ?, ?,
?)")) {
-            setObjectSmart(st, 1, p.key());
-            setObjectSmart(st, 2, p);
-            setObjectSmart(st, 3, p.id);
-            setObjectSmart(st, 4, p.firstName);
-            setObjectSmart(st, 5, p.lastName);
-            setObjectSmart(st, 6, p.orgId);
-            setObjectSmart(st, 7, p.salary);
+            st.setObject(1, p.key());
+            st.setObject(2, p);
+            st.setObject(3, p.id);
+            st.setObject(4, p.firstName);
+            st.setObject(5, p.lastName);
+            st.setObject(6, p.orgId);
+            st.setObject(7, p.salary);
 
             st.executeUpdate();
         }
@@ -255,11 +255,11 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     private void insertInDb(Product p) throws SQLException {
         try(PreparedStatement st = conn.prepareStatement(
             "insert into \"repl\".PRODUCT (_key, _val, id, name, price) values(?, ?, ?, ?,
?)")) {
-            setObjectSmart(st, 1, p.id);
-            setObjectSmart(st, 2, p);
-            setObjectSmart(st, 3, p.id);
-            setObjectSmart(st, 4, p.name);
-            setObjectSmart(st, 5, p.price);
+            st.setObject(1, p.id);
+            st.setObject(2, p);
+            st.setObject(3, p.id);
+            st.setObject(4, p.name);
+            st.setObject(5, p.price);
 
             st.executeUpdate();
         }
@@ -274,11 +274,11 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     private void insertInDb(Purchase p) throws SQLException {
         try(PreparedStatement st = conn.prepareStatement(
             "insert into \"part\".PURCHASE (_key, _val, id, personId, productId) values(?,
?, ?, ?, ?)")) {
-            setObjectSmart(st, 1, p.key());
-            setObjectSmart(st, 2, p);
-            setObjectSmart(st, 3, p.id);
-            setObjectSmart(st, 4, p.personId);
-            setObjectSmart(st, 5, p.productId);
+            st.setObject(1, p.key());
+            st.setObject(2, p);
+            st.setObject(3, p.id);
+            st.setObject(4, p.personId);
+            st.setObject(5, p.productId);
 
             st.executeUpdate();
         }
@@ -429,7 +429,7 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
 
         try(PreparedStatement st = conn.prepareStatement(sql)) {
             for (int idx = 0; idx < args.length; idx++)
-                setObjectSmart(st, idx + 1, args[idx]);
+                st.setObject(idx + 1, args[idx]);
 
             rs = st.executeQuery();
 
@@ -452,21 +452,6 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Do a smart setting of given object at statement.
-     *
-     * @param st Statment.
-     * @param idx Index.
-     * @param arg Argument.
-     * @throws SQLException If exception.
-     */
-    private void setObjectSmart(PreparedStatement st, int idx, Object arg) throws SQLException
{
-        if (arg == null)
-            st.setNull(idx, Types.NULL);
-        else
-            st.setObject(idx, arg);
-    }
-
-    /**
      * Assert equals of result sets according to expected ordering.
      *
      * @param rs1 Expected result set.


Mime
View raw message