updated from comments

This commit is contained in:
Willem 2015-12-27 16:38:49 +01:00
parent ceab91eb5d
commit 8833933ebe
4 changed files with 20 additions and 15 deletions

View file

@ -20,7 +20,7 @@ FF-TPQuery is a java8 library providing templated prepared statements.
<dependency>
<groupId>net.forwardfire.tpquery</groupId>
<artifactId>tpquery-store</artifactId>
<artifactId>ff-tpquery-store</artifactId>
<version>1.5.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
@ -33,9 +33,9 @@ FF-TPQuery is a java8 library providing templated prepared statements.
* 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.
* ff-tpquery-executor-jdbc - Jdbc executor implementation.
* ff-tpquery-executor-jpa - JPA executor implementation.
* ff-tpquery-store - The query store library.
## Contributing

View file

@ -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

View file

@ -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

View file

@ -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
}
}
}