aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-21 23:46:36 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-02-21 23:46:36 +1300
commit886eb61ff0961d7e3be4e926d1510994b3df84e2 (patch)
tree7985a4b04ed48548371f9faa07d9bbe0c0f056c8 /src
parentde43b1203b70a27c2833129983b86253371834d9 (diff)
downloadtraccar-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.tar.gz
traccar-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.tar.bz2
traccar-server-886eb61ff0961d7e3be4e926d1510994b3df84e2.zip
Ignore marked methods in query builder (fix #2941)
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/database/QueryBuilder.java7
-rw-r--r--src/org/traccar/model/Geofence.java1
2 files changed, 6 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);
diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java
index f10ce6862..ffd4876bf 100644
--- a/src/org/traccar/model/Geofence.java
+++ b/src/org/traccar/model/Geofence.java
@@ -79,6 +79,7 @@ public class Geofence extends Extensible {
return geometry;
}
+ @JsonIgnore
public void setGeometry(GeofenceGeometry geometry) {
area = geometry.toWkt();
this.geometry = geometry;