From 9120ff19ab2bdd466ae5c30632efd1917faa71b1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 28 Feb 2017 08:09:10 +1300 Subject: Add separate QueryIgnore annotation (fix #2962) --- src/org/traccar/database/QueryBuilder.java | 5 ++--- src/org/traccar/database/QueryIgnore.java | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/org/traccar/database/QueryIgnore.java (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 83bc5de2e..a24e6f0bf 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -15,7 +15,6 @@ */ 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; @@ -262,7 +261,7 @@ public final class QueryBuilder { for (Method method : methods) { if (method.getName().startsWith("get") && method.getParameterTypes().length == 0 - && !method.isAnnotationPresent(JsonIgnore.class)) { + && !method.isAnnotationPresent(QueryIgnore.class)) { String name = method.getName().substring(3); try { if (method.getReturnType().equals(boolean.class)) { @@ -427,7 +426,7 @@ public final class QueryBuilder { for (final Method method : methods) { if (method.getName().startsWith("set") && method.getParameterTypes().length == 1 - && !method.isAnnotationPresent(JsonIgnore.class)) { + && !method.isAnnotationPresent(QueryIgnore.class)) { final String name = method.getName().substring(3); diff --git a/src/org/traccar/database/QueryIgnore.java b/src/org/traccar/database/QueryIgnore.java new file mode 100644 index 000000000..ac835cf2f --- /dev/null +++ b/src/org/traccar/database/QueryIgnore.java @@ -0,0 +1,26 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.database; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface QueryIgnore { +} -- cgit v1.2.3