Review notes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d93e1dbd Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d93e1dbd Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d93e1dbd Branch: refs/heads/ignite-1258 Commit: d93e1dbde5b22688530dd4deacbb06467f7e2b13 Parents: e0f445e Author: Alexey Kuznetsov <akuznet...@apache.org> Authored: Thu Aug 20 17:44:10 2015 +0700 Committer: Alexey Kuznetsov <akuznet...@apache.org> Committed: Thu Aug 20 17:44:10 2015 +0700 ---------------------------------------------------------------------- .../cache/store/jdbc/CacheJdbcPojoStore.java | 20 ++++++++-------- .../store/jdbc/CacheJdbcPojoStoreTest.java | 24 +++++++++++++++----- .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 3 --- 3 files changed, 28 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d93e1dbd/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 428485f..1ff170e 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 @@ -99,8 +99,8 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> { getters.put(field.getJavaName(), cls.getMethod("is" + prop)); } catch (NoSuchMethodException e) { - throw new CacheException("Failed to find getter in POJO class [class name=" + clsName + - ", property=" + field.getJavaName() + "]", e); + throw new CacheException("Failed to find getter in POJO class [clsName=" + clsName + + ", prop=" + field.getJavaName() + "]", e); } } @@ -108,8 +108,8 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> { setters.put(field.getJavaName(), cls.getMethod("set" + prop, field.getJavaType())); } catch (NoSuchMethodException e) { - throw new CacheException("Failed to find setter in POJO class [class name=" + clsName + - ", property=" + field.getJavaName() + "]", e); + throw new CacheException("Failed to find setter in POJO class [clsName=" + clsName + + ", prop=" + field.getJavaName() + "]", e); } } } @@ -172,8 +172,8 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> { Method setter = mc.setters.get(fldJavaName); if (setter == null) - throw new IllegalStateException("Failed to find setter in POJO class [class name=" + typeName + - ", property=" + fldJavaName + "]"); + throw new IllegalStateException("Failed to find setter in POJO class [clsName=" + typeName + + ", prop=" + fldJavaName + "]"); String fldDbName = field.getDatabaseName(); @@ -183,8 +183,8 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> { setter.invoke(obj, getColumnValue(rs, colIdx, field.getJavaType())); } catch (Exception e) { - throw new IllegalStateException("Failed to set property in POJO class [class name=" + typeName + - ", property=" + fldJavaName + ", column=" + colIdx + ", db name=" + fldDbName + "]", e); + throw new IllegalStateException("Failed to set property in POJO class [clsName=" + typeName + + ", prop=" + fldJavaName + ", col=" + colIdx + ", dbName=" + fldDbName + "]", e); } } @@ -214,8 +214,8 @@ public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> { Method getter = mc.getters.get(fieldName); if (getter == null) - throw new CacheLoaderException("Failed to find getter in POJO class [class name=" + typeName + - ", property=" + fieldName + "]"); + throw new CacheLoaderException("Failed to find getter in POJO class [clsName=" + typeName + + ", prop=" + fieldName + "]"); return getter.invoke(obj); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d93e1dbd/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java index b1efb0d..68a77dc 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java @@ -183,12 +183,24 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache // No-op. } - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS String_Entries (key varchar(100) not null, val varchar(100), PRIMARY KEY(key))"); - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS UUID_Entries (key binary(16) not null, val binary(16), PRIMARY KEY(key))"); - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS Timestamp_Entries (key timestamp not null, val integer, PRIMARY KEY(key))"); - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS Organization (id integer not null, name varchar(50), city varchar(50), PRIMARY KEY(id))"); - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS Person (id integer not null, org_id integer, name varchar(50), PRIMARY KEY(id))"); - stmt.executeUpdate("CREATE TABLE IF NOT EXISTS Person_Complex (id integer not null, org_id integer not null, city_id integer not null, name varchar(50), salary integer, PRIMARY KEY(id))"); + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "String_Entries (key varchar(100) not null, val varchar(100), PRIMARY KEY(key))"); + + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "UUID_Entries (key binary(16) not null, val binary(16), PRIMARY KEY(key))"); + + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "Timestamp_Entries (key timestamp not null, val integer, PRIMARY KEY(key))"); + + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "Organization (id integer not null, name varchar(50), city varchar(50), PRIMARY KEY(id))"); + + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "Person (id integer not null, org_id integer, name varchar(50), PRIMARY KEY(id))"); + + stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " + + "Person_Complex (id integer not null, org_id integer not null, city_id integer not null, " + + "name varchar(50), salary integer, PRIMARY KEY(id))"); conn.commit(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d93e1dbd/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java index faaf28f..8b4f3f9 100644 --- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java @@ -62,9 +62,6 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest { checkStore(cache, JdbcDataSource.class); } } - catch (Exception e) { - fail("Failed to validate cache configuration. Cache store factory is not serializable."); - } } /**