diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-21 23:46:36 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-21 23:46:36 +1300 |
commit | 886eb61ff0961d7e3be4e926d1510994b3df84e2 (patch) | |
tree | 7985a4b04ed48548371f9faa07d9bbe0c0f056c8 /src/org/traccar/database/QueryBuilder.java | |
parent | de43b1203b70a27c2833129983b86253371834d9 (diff) | |
download | trackermap-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.tar.gz trackermap-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.tar.bz2 trackermap-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.zip |
Ignore marked methods in query builder (fix #2941)
Diffstat (limited to 'src/org/traccar/database/QueryBuilder.java')
-rw-r--r-- | src/org/traccar/database/QueryBuilder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 9972bb74d..83bc5de2e 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -15,6 +15,7 @@ */ package org.traccar.database; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.JsonProcessingException; import org.traccar.Context; import org.traccar.helper.Log; @@ -260,7 +261,8 @@ public final class QueryBuilder { Method[] methods = object.getClass().getMethods(); for (Method method : methods) { - if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) { + if (method.getName().startsWith("get") && method.getParameterTypes().length == 0 + && !method.isAnnotationPresent(JsonIgnore.class)) { String name = method.getName().substring(3); try { if (method.getReturnType().equals(boolean.class)) { @@ -424,7 +426,8 @@ public final class QueryBuilder { Method[] methods = clazz.getMethods(); for (final Method method : methods) { - if (method.getName().startsWith("set") && method.getParameterTypes().length == 1) { + if (method.getName().startsWith("set") && method.getParameterTypes().length == 1 + && !method.isAnnotationPresent(JsonIgnore.class)) { final String name = method.getName().substring(3); |