aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-20 02:13:32 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-20 10:14:12 +1300
commit301b44775fb4ed66fae5c801da3c52f7b88b9697 (patch)
tree930a340daa4d96222b430528ff459a8ac2d2395a /src/org
parent037c56737afbae584a0e7637094ea0aa1b359675 (diff)
downloadtrackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.tar.gz
trackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.tar.bz2
trackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.zip
Fix JSON decoding in query builder
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/database/QueryBuilder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java
index 127229700..9b25f72fc 100644
--- a/src/org/traccar/database/QueryBuilder.java
+++ b/src/org/traccar/database/QueryBuilder.java
@@ -308,7 +308,8 @@ public final class QueryBuilder {
}
private <T> void addProcessors(
- List<ResultSetProcessor<T>> processors, Class<?> parameterType, final Method method, final String name) {
+ List<ResultSetProcessor<T>> processors,
+ final Class<?> parameterType, final Method method, final String name) {
if (parameterType.equals(boolean.class)) {
processors.add(new ResultSetProcessor<T>() {
@@ -397,7 +398,7 @@ public final class QueryBuilder {
String value = resultSet.getString(name);
if (value != null) {
try {
- method.invoke(object, Context.getObjectMapper().readValue(value, Map.class));
+ method.invoke(object, Context.getObjectMapper().readValue(value, parameterType.getClass()));
} catch (InvocationTargetException | IllegalAccessException | IOException error) {
Log.warning(error);
}