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 601a237664d15..a92ff95cf9efa 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 @@ * * This implementation stores objects in underlying database using java beans mapping description via reflection. * - * @param the type of keys handled by this loader - * @param the type of values generated by this loader + * @param The type of keys handled by this loader. + * @param The type of values generated by this loader. */ public class CacheJdbcPojoStore extends CacheAbstractJdbcStore { /** @@ -48,8 +48,8 @@ protected static class PojoMethodsCache { /** 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 getters; @@ -67,7 +67,8 @@ public PojoMethodsCache(String clsName, Collection field 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 PojoMethodsCache(String clsName, Collection field 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 PojoMethodsCache(String clsName, Collection field 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);