diff --git a/xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/datasets/filters/Filters.java b/xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/datasets/filters/Filters.java index 97dd480f28..92d935d572 100644 --- a/xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/datasets/filters/Filters.java +++ b/xyz-jobs/xyz-job-service/src/main/java/com/here/xyz/jobs/datasets/filters/Filters.java @@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonView; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.here.xyz.XyzSerializable; import com.here.xyz.XyzSerializable.Internal; import com.here.xyz.XyzSerializable.Public; import com.here.xyz.XyzSerializable.Static; @@ -54,7 +56,11 @@ public PropertiesQuery getPropertyFilter() { public void setPropertyFilter(Object propertyFilter) { if (propertyFilter instanceof ArrayList propFilter){ - this.propertyFilter = new PropertiesQuery(propFilter); + try { + this.propertyFilter = XyzSerializable.deserialize(XyzSerializable.serialize(propFilter), PropertiesQuery.class); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } } else if (propertyFilter instanceof String propFilter) { this.propertyFilter = PropertiesQuery.fromString(propFilter); diff --git a/xyz-models/src/main/java/com/here/xyz/events/PropertyQuery.java b/xyz-models/src/main/java/com/here/xyz/events/PropertyQuery.java index f86825089f..865bb95b18 100644 --- a/xyz-models/src/main/java/com/here/xyz/events/PropertyQuery.java +++ b/xyz-models/src/main/java/com/here/xyz/events/PropertyQuery.java @@ -21,6 +21,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeName; +import com.here.xyz.XyzSerializable; + import java.math.BigDecimal; import java.util.Arrays; import java.util.List; @@ -29,7 +31,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) @JsonTypeName(value = "PropertyQuery") -public class PropertyQuery { +public class PropertyQuery implements XyzSerializable { private String key; private QueryOperation operation; @@ -173,7 +175,20 @@ else if (thisValue instanceof BigDecimal && otherValue instanceof Long) { if (!thisValue.equals(new BigDecimal((Long) otherValue))) { return false; } - } else if (!thisValue.equals(otherValue)) { + } + // Convert Integer to Long and BigDecimal + else if (thisValue instanceof Integer && otherValue instanceof BigDecimal) { + if (!new BigDecimal((Integer) thisValue).equals(otherValue)) { + return false; + } + } + // Convert BigDecimal to Integer and compare + else if (thisValue instanceof BigDecimal && otherValue instanceof Integer) { + if (!thisValue.equals(new BigDecimal((Integer) otherValue))) { + return false; + } + } + else if (!thisValue.equals(otherValue)) { return false; // If the values are not equal, return false } }