diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-20 02:13:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-20 10:14:12 +1300 |
commit | 301b44775fb4ed66fae5c801da3c52f7b88b9697 (patch) | |
tree | 930a340daa4d96222b430528ff459a8ac2d2395a | |
parent | 037c56737afbae584a0e7637094ea0aa1b359675 (diff) | |
download | trackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.tar.gz trackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.tar.bz2 trackermap-server-301b44775fb4ed66fae5c801da3c52f7b88b9697.zip |
Fix JSON decoding in query builder
-rw-r--r-- | src/org/traccar/database/QueryBuilder.java | 5 |
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); } |