# IGNITE-329 Review.

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

Branch: refs/heads/ignite-gg-9828
Commit: d7a969bd653f01a712bfa3e2fe5d4bfc6387f724
Parents: 49fa33d
Author: AKuznetsov <akuznet...@gridgain.com>
Authored: Tue Mar 10 17:47:48 2015 +0700
Committer: AKuznetsov <akuznet...@gridgain.com>
Committed: Tue Mar 10 17:47:48 2015 +0700

----------------------------------------------------------------------
 .../ignite/cache/store/jdbc/CacheJdbcPojoStore.java  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d7a969bd/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index 601a237..a92ff95 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -34,8 +34,8 @@ import java.util.*;
  *
  * This implementation stores objects in underlying database using java beans 
mapping description via reflection.
  *
- * @param <K> the type of keys handled by this loader
- * @param <V> the type of values generated by this loader
+ * @param <K> The type of keys handled by this loader.
+ * @param <V> The type of values generated by this loader.
  */
 public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> {
     /**
@@ -48,8 +48,8 @@ public class CacheJdbcPojoStore<K, V> extends 
CacheAbstractJdbcStore<K, V> {
         /** Constructor for POJO object. */
         private Constructor ctor;
 
-        /** Key have simple type. */
-        private final boolean simpleKey;
+        /** {@code true} if object is a simple type. */
+        private final boolean simple;
 
         /** Cached setters for POJO object. */
         private Map<String, Method> getters;
@@ -67,7 +67,8 @@ public class CacheJdbcPojoStore<K, V> extends 
CacheAbstractJdbcStore<K, V> {
             try {
                 cls = Class.forName(clsName);
 
-                if (simpleKey = (Number.class.isAssignableFrom(cls) || 
cls.isInstance(String.class)))
+                if (simple = (Number.class.isAssignableFrom(cls) || 
String.class.isAssignableFrom(cls) ||
+                    java.util.Date.class.isAssignableFrom(cls)) || 
Boolean.class.isAssignableFrom(cls))
                     return;
 
                 ctor = cls.getDeclaredConstructor();
@@ -156,7 +157,7 @@ public class CacheJdbcPojoStore<K, V> extends 
CacheAbstractJdbcStore<K, V> {
             throw new CacheLoaderException("Failed to find cache type metadata 
for type: " + typeName);
 
         try {
-            if (mc.simpleKey) {
+            if (mc.simple) {
                 CacheTypeFieldMetadata field = F.first(fields);
 
                 return (R)getColumnValue(rs, 
loadColIdxs.get(field.getDatabaseName()), mc.cls);
@@ -195,7 +196,7 @@ public class CacheJdbcPojoStore<K, V> extends 
CacheAbstractJdbcStore<K, V> {
             if (mc == null)
                 throw new CacheException("Failed to find cache type metadata 
for type: " + typeName);
 
-            if (mc.simpleKey)
+            if (mc.simple)
                 return obj;
 
             Method getter = mc.getters.get(fieldName);

Reply via email to