From 8833933ebed815974c979f4f201087c26a135485 Mon Sep 17 00:00:00 2001 From: Willem Date: Sun, 27 Dec 2015 16:38:49 +0100 Subject: [PATCH] updated from comments --- README.md | 20 +++++++++---------- TODO.md | 3 +++ .../net/forwardfire/tpquery/TPQFactory.java | 10 ++++++---- .../language/TPQStatementLanguageHql.java | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 46667b1..3b2175e 100644 --- a/README.md +++ b/README.md @@ -20,22 +20,22 @@ FF-TPQuery is a java8 library providing templated prepared statements. net.forwardfire.tpquery - tpquery-store + ff-tpquery-store 1.5.0-SNAPSHOT compile ## Files in this package -* build.md - Developer build commands. -* license.txt - The license of tpquery. -* pom.xml - Maven specific build file. -* readme.md - This file. -* todo.md - Small todo list. -* src - site source. -* tpquery-executor-jdbc - Jdbc executor implementation. -* tpquery-executor-jpa - JPA executor implementation. -* tpquery-store - The query store library. +* build.md - Developer build commands. +* license.txt - The license of tpquery. +* pom.xml - Maven specific build file. +* readme.md - This file. +* todo.md - Small todo list. +* src - site source. +* ff-tpquery-executor-jdbc - Jdbc executor implementation. +* ff-tpquery-executor-jpa - JPA executor implementation. +* ff-tpquery-store - The query store library. ## Contributing diff --git a/TODO.md b/TODO.md index fc751ee..392e339 100644 --- a/TODO.md +++ b/TODO.md @@ -9,7 +9,10 @@ * finish jdoc * finish site * rename prepared writers +* check type checking; lang-or-executor * Add jmx stats bean +* Add ldap support ? +* Add mongo support ? ## Ideas diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/TPQFactory.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/TPQFactory.java index 808432f..92f2f93 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/TPQFactory.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/TPQFactory.java @@ -77,7 +77,7 @@ public final class TPQFactory { public void initializeConfig(TPQConfig config) { // temp here move to better place. config.setTreePathSeperator(TPQFactory.DEFAULT_TREEPATH_SEPERATOR); - config.setDefaultParameterNullable(DEFAULT_PARAMETER_NULLABLE); + config.setDefaultParameterNullable(TPQFactory.DEFAULT_PARAMETER_NULLABLE); config.setDefaultParameterType(TPQFactory.StatementParameter.VALUE); config.setStatementCache(new TPQStoreManagerStatementCache()); } @@ -191,7 +191,7 @@ public final class TPQFactory { public void initializeConfig(TPQConfig config) { config.addStatementParameter(new TPQStatementParameterValue(VALUE)); config.addStatementParameter(new TPQStatementParameterList(LIST)); - config.addStatementParameter(new TPQStatementParameterRaw(RAW,"")); + config.addStatementParameter(new TPQStatementParameterRaw(RAW,"")); // TODO: write best-practice-example and remove raw* from default ? config.addStatementParameter(new TPQStatementParameterRaw(RAW_NULL,"null")); } } @@ -250,6 +250,8 @@ public final class TPQFactory { @Override public void initializeConfig(TPQConfig config) { + + // pure java types addValueType(config, JAVA_OBJECT); addValueType(config, BIGDECIMAL); addValueType(config, BOOLEAN); @@ -262,6 +264,7 @@ public final class TPQFactory { addValueType(config, URL); addValueType(config, BYTE_DATA); + // jdbc sql types addValueType(config, SQL_ARRAY); addValueType(config, SQL_BLOB); addValueType(config, SQL_CLOB); @@ -275,7 +278,6 @@ public final class TPQFactory { addValueType(config, SQL_TIMESTAMP); } - // load here because in builder we like to use static fields.(as text) private void addValueType(TPQConfig config,String className) { try { config.addValueType(ClassUtils.getClass(className)); @@ -501,7 +503,7 @@ public final class TPQFactory { private TPQueryStoreScriptEngine createScriptEngine() { ScriptEngine engine = new ScriptEngineManager().getEngineByMimeType(DEFAULT_SCRIPT_ENGINE_MINE_TYPE); - Validate.isInstanceOf(Compilable.class, engine, "ScriptEngine does not implement Compilable interface."); + Validate.isInstanceOf(Compilable.class, engine, "ScriptEngine does not implement Compilable interface.");// TODO: use TPQueryStoreScriptEngine interface list Validate.isInstanceOf(Invocable.class, engine, "ScriptEngine does not implement Invocable interface."); return (TPQueryStoreScriptEngine) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{TPQueryStoreScriptEngine.class}, new InvocationHandler() { @Override diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/statement/language/TPQStatementLanguageHql.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/statement/language/TPQStatementLanguageHql.java index 7d3180b..4e9c7cc 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/statement/language/TPQStatementLanguageHql.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/statement/language/TPQStatementLanguageHql.java @@ -56,7 +56,7 @@ public class TPQStatementLanguageHql extends AbstractTPQStatementLanguage { @Override public void appendQueryParameter(TPQueryStoreStatementMapper valueMapper) { super.appendQueryParameter(valueMapper); - getOutputBuffer().append(getQueryParameterMapping().size()); + getOutputBuffer().append(getQueryParameterMapping().size()); // append parameter index } } }