From 4b77243d9e518a9a0e5aae3f4346d42acccb20b4 Mon Sep 17 00:00:00 2001 From: shawkins Date: Mon, 24 Sep 2018 13:11:00 -0400 Subject: [PATCH] OLINGO-1293 adding srid to property metadata --- .../core/serializer/json/MetadataDocumentJsonSerializer.java | 4 ++++ .../core/serializer/xml/MetadataDocumentXmlSerializer.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java index 7c9e9570e..9d7c27653 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/MetadataDocumentJsonSerializer.java @@ -714,6 +714,10 @@ public class MetadataDocumentJsonSerializer { if (property.getScale() != null) { json.writeNumberField(SCALE, property.getScale()); } + + if (property.getSrid() != null) { + json.writeStringField(SRID, "" + property.getSrid()); + } appendAnnotations(json, property, null); json.writeEndObject(); diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java index 250544068..e2930008e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java @@ -96,6 +96,7 @@ public class MetadataDocumentXmlSerializer { private static final String XML_PROPERTY_REF = "PropertyRef"; private static final String XML_KEY = "Key"; private static final String XML_SCALE = "Scale"; + private static final String XML_SRID = "SRID"; private static final String XML_PRECISION = "Precision"; private static final String XML_MAX_LENGTH = "MaxLength"; private static final String XML_DEFAULT_VALUE = "DefaultValue"; @@ -905,6 +906,10 @@ public class MetadataDocumentXmlSerializer { if (property.getScale() != null) { writer.writeAttribute(XML_SCALE, "" + property.getScale()); } + + if (property.getSrid() != null) { + writer.writeAttribute(XML_SRID, "" + property.getSrid()); + } appendAnnotations(writer, property); writer.writeEndElement();