ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/4] incubator-ignite git commit: # IGNITE-32 WIP: Minor changes.
Date Sun, 28 Dec 2014 04:25:51 GMT
# IGNITE-32 WIP: Minor changes.


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

Branch: refs/heads/ignite-32
Commit: 0d907c4e0304cf9e94a2769d5a888a1218d05500
Parents: d34e6fd
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Sun Dec 28 11:22:35 2014 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Sun Dec 28 11:22:35 2014 +0700

----------------------------------------------------------------------
 .../ignite/schema/pojo/PojoCodeGenerator.java   | 12 ++-
 .../src/test/config/ORGANIZATION.xml            | 94 --------------------
 modules/schema-load/src/test/config/PERSON.xml  | 92 -------------------
 .../java/org/apache/ignite/Organization.java    | 12 ++-
 .../java/org/apache/ignite/OrganizationKey.java | 11 ++-
 .../src/test/java/org/apache/ignite/Person.java | 20 ++---
 .../test/java/org/apache/ignite/PersonKey.java  | 11 ++-
 7 files changed, 32 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/main/java/org/apache/ignite/schema/pojo/PojoCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/pojo/PojoCodeGenerator.java
b/modules/schema-load/src/main/java/org/apache/ignite/schema/pojo/PojoCodeGenerator.java
index a46b8cd..37c0d17 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/pojo/PojoCodeGenerator.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/pojo/PojoCodeGenerator.java
@@ -160,7 +160,8 @@ public class PojoCodeGenerator {
 
         for (GridCacheQueryTypeDescriptor desc : descs) {
             add0(src, "");
-            add2(src, String.format("if (%1$s != null ? !%1$s.equals(that.%1$s) : that.%1$s
!= null)", desc.getJavaName()));
+            add2(src, String.format("if (%1$s != null ? !%1$s.equals(that.%1$s) : that.%1$s
!= null)",
+                desc.getJavaName()));
             add3(src, "return false;");
         }
 
@@ -177,10 +178,13 @@ public class PojoCodeGenerator {
 
         add2(src, String.format("int res = %1$s != null ? %1$s.hashCode() : 0;", it.next().getJavaName()));
 
-        add0(src, "");
+        if (it.hasNext()) {
+            add0(src, "");
 
-        while(it.hasNext())
-            add2(src, String.format("res = 31 * res + (%1$s != null ? %1$s.hashCode() : 0);",
it.next().getJavaName()));
+            while (it.hasNext())
+                add2(src, String.format("res = 31 * res + (%1$s != null ? %1$s.hashCode()
: 0);",
+                    it.next().getJavaName()));
+        }
 
         add0(src, "");
         add2(src, "return res;");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/config/ORGANIZATION.xml
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/config/ORGANIZATION.xml b/modules/schema-load/src/test/config/ORGANIZATION.xml
deleted file mode 100644
index 466070f..0000000
--- a/modules/schema-load/src/test/config/ORGANIZATION.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeMetadata">
-        <property name="type" value="org.apache.ignite.Organization"/>
-        <property name="keyType" value="org.apache.ignite.OrganizationKey"/>
-        <property name="schema" value="PUBLIC"/>
-        <property name="tableName" value="ORGANIZATION"/>
-        <property name="keyDescriptors">
-            <list>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="id"/>
-                    <property name="javaType" value="java.lang.Integer"/>
-                    <property name="dbName" value="ID"/>
-                    <property name="dbType" value="4"/>
-                </bean>
-            </list>
-        </property>
-        <property name="valueDescriptors">
-            <list>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="id"/>
-                    <property name="javaType" value="java.lang.Integer"/>
-                    <property name="dbName" value="ID"/>
-                    <property name="dbType" value="4"/>
-                </bean>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="name"/>
-                    <property name="javaType" value="java.lang.String"/>
-                    <property name="dbName" value="NAME"/>
-                    <property name="dbType" value="12"/>
-                </bean>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="city"/>
-                    <property name="javaType" value="java.lang.String"/>
-                    <property name="dbName" value="CITY"/>
-                    <property name="dbType" value="12"/>
-                </bean>
-            </list>
-        </property>
-        <property name="queryFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-                <entry key="city" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="ascendingFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-                <entry key="city" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="groups">
-            <map>
-                <entry key="primaryKeyD">
-                    <map>
-                        <entry key="id">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.Integer"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="orgNameCityIdx">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.String"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                        <entry key="city">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.String"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="orgNameIdx">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.String"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-            </map>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/config/PERSON.xml
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/config/PERSON.xml b/modules/schema-load/src/test/config/PERSON.xml
deleted file mode 100644
index 6b7a6cc..0000000
--- a/modules/schema-load/src/test/config/PERSON.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-    <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeMetadata">
-        <property name="type" value="org.apache.ignite.Person"/>
-        <property name="keyType" value="org.apache.ignite.PersonKey"/>
-        <property name="schema" value="PUBLIC"/>
-        <property name="tableName" value="PERSON"/>
-        <property name="keyDescriptors">
-            <list>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="id"/>
-                    <property name="javaType" value="java.lang.Integer"/>
-                    <property name="dbName" value="ID"/>
-                    <property name="dbType" value="4"/>
-                </bean>
-            </list>
-        </property>
-        <property name="valueDescriptors">
-            <list>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="id"/>
-                    <property name="javaType" value="java.lang.Integer"/>
-                    <property name="dbName" value="ID"/>
-                    <property name="dbType" value="4"/>
-                </bean>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="orgId"/>
-                    <property name="javaType" value="java.lang.Integer"/>
-                    <property name="dbName" value="ORG_ID"/>
-                    <property name="dbType" value="4"/>
-                </bean>
-                <bean class="org.gridgain.grid.cache.query.GridCacheQueryTypeDescriptor">
-                    <property name="javaName" value="name"/>
-                    <property name="javaType" value="java.lang.String"/>
-                    <property name="dbName" value="NAME"/>
-                    <property name="dbType" value="12"/>
-                </bean>
-            </list>
-        </property>
-        <property name="queryFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="orgId" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="ascendingFields">
-            <map>
-                <entry key="id" value="java.lang.Integer"/>
-                <entry key="name" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="descendingFields">
-            <map>
-                <entry key="name" value="java.lang.String"/>
-            </map>
-        </property>
-        <property name="groups">
-            <map>
-                <entry key="primaryKey8">
-                    <map>
-                        <entry key="id">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.Integer"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="personNameIdx1">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.String"/>
-                                <constructor-arg type="java.lang.Object" value="false"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-                <entry key="personNameIdx2">
-                    <map>
-                        <entry key="name">
-                            <bean class="org.apache.ignite.lang.IgniteBiTuple">
-                                <constructor-arg type="java.lang.Object" value="java.lang.String"/>
-                                <constructor-arg type="java.lang.Object" value="true"/>
-                            </bean>
-                        </entry>
-                    </map>
-                </entry>
-            </map>
-        </property>
-    </bean>
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/Organization.java b/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
index b6acefa..50c1a40 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/Organization.java
@@ -8,7 +8,6 @@ public class Organization {
 
     private String city;
 
-
     public Integer getId() {
         return id;
     }
@@ -60,7 +59,6 @@ public class Organization {
         int res = id != null ? id.hashCode() : 0;
 
         res = 31 * res + (name != null ? name.hashCode() : 0);
-
         res = 31 * res + (city != null ? city.hashCode() : 0);
 
         return res;
@@ -68,10 +66,10 @@ public class Organization {
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return "Organization ["
-            + " id=" + id
-            + " name=" + name
-            + " city=" + city
-         + "]";
+        return "Organization [" + 
+            " id=" + id + 
+            " name=" + name + 
+            " city=" + city + 
+        "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java b/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
index e2434f0..08ee36f 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/OrganizationKey.java
@@ -4,7 +4,6 @@ package org.apache.ignite;
 public class OrganizationKey {
     private Integer id;
 
-
     public Integer getId() {
         return id;
     }
@@ -31,15 +30,15 @@ public class OrganizationKey {
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int result = id != null ? id.hashCode() : 0;
+        int res = id != null ? id.hashCode() : 0;
 
-        return result;
+        return res;
     }
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return "OrganizationKey ["
-            + " id=" + id
-         + "]";
+        return "OrganizationKey [" + 
+            " id=" + id + 
+        "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/java/org/apache/ignite/Person.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/Person.java b/modules/schema-load/src/test/java/org/apache/ignite/Person.java
index 073f0d9..1ce68d8 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/Person.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/Person.java
@@ -8,7 +8,6 @@ public class Person {
 
     private String name;
 
-
     public Integer getId() {
         return id;
     }
@@ -57,21 +56,20 @@ public class Person {
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int result = id != null ? id.hashCode() : 0;
-
-        result = 31 * result + (orgId != null ? orgId.hashCode() : 0);
+        int res = id != null ? id.hashCode() : 0;
 
-        result = 31 * result + (name != null ? name.hashCode() : 0);
+        res = 31 * res + (orgId != null ? orgId.hashCode() : 0);
+        res = 31 * res + (name != null ? name.hashCode() : 0);
 
-        return result;
+        return res;
     }
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return "Person ["
-            + " id=" + id
-            + " orgId=" + orgId
-            + " name=" + name
-         + "]";
+        return "Person [" + 
+            " id=" + id + 
+            " orgId=" + orgId + 
+            " name=" + name + 
+        "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d907c4e/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java b/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
index 755b0f7..64a5511 100644
--- a/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
+++ b/modules/schema-load/src/test/java/org/apache/ignite/PersonKey.java
@@ -4,7 +4,6 @@ package org.apache.ignite;
 public class PersonKey {
     private Integer id;
 
-
     public Integer getId() {
         return id;
     }
@@ -31,15 +30,15 @@ public class PersonKey {
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int result = id != null ? id.hashCode() : 0;
+        int res = id != null ? id.hashCode() : 0;
 
-        return result;
+        return res;
     }
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return "PersonKey ["
-            + " id=" + id
-         + "]";
+        return "PersonKey [" + 
+            " id=" + id + 
+        "]";
     }
 }


Mime
View raw message