From 301b44775fb4ed66fae5c801da3c52f7b88b9697 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 20 Dec 2016 02:13:32 +1300 Subject: Fix JSON decoding in query builder --- src/org/traccar/database/QueryBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/org') 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 void addProcessors( - List> processors, Class parameterType, final Method method, final String name) { + List> processors, + final Class parameterType, final Method method, final String name) { if (parameterType.equals(boolean.class)) { processors.add(new ResultSetProcessor() { @@ -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); } -- cgit v1.2.3