diff options
author | Daniel Silverthorn <daniel.silverthorn@amdocs.com> | 2018-01-31 16:54:06 -0500 |
---|---|---|
committer | Daniel Silverthorn <daniel.silverthorn@amdocs.com> | 2018-01-31 16:55:29 -0500 |
commit | 56f24334a64166ad1bae43f1b8d1b9e1e3c7e2d7 (patch) | |
tree | d8b0cd92db478c31fe740705e4d28a51a88df7d6 /src/main/java/org/onap/schema/OxmModelValidator.java | |
parent | 1bb61ff3e013bcd41beffc5d9f01964f422f8a9e (diff) |
Allow reserved properties in get
Change-Id: Ia3c81df8ea9da5b49f1344726c799757678791eb
Issue-ID: AAI-702
Signed-off-by: Daniel Silverthorn <daniel.silverthorn@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/schema/OxmModelValidator.java')
-rw-r--r-- | src/main/java/org/onap/schema/OxmModelValidator.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/org/onap/schema/OxmModelValidator.java b/src/main/java/org/onap/schema/OxmModelValidator.java index ae3e18b..1607f18 100644 --- a/src/main/java/org/onap/schema/OxmModelValidator.java +++ b/src/main/java/org/onap/schema/OxmModelValidator.java @@ -44,11 +44,11 @@ import javax.ws.rs.core.Response.Status; public class OxmModelValidator { public enum Metadata { - NODE_TYPE("aai-node-type"), - URI("aai-uri"), - CREATED_TS("aai-created-ts"), - UPDATED_TS("aai-last-mod-ts"), - SOT("source-of-truth"), + NODE_TYPE("aai-node-type"), + URI("aai-uri"), + CREATED_TS("aai-created-ts"), + UPDATED_TS("aai-last-mod-ts"), + SOT("source-of-truth"), LAST_MOD_SOT("last-mod-source-of-truth"); private final String propName; @@ -318,13 +318,15 @@ public class OxmModelValidator { vertex.getProperties().get(Metadata.NODE_TYPE.propertyName()) != null ? vertex.getProperties().get(Metadata.NODE_TYPE.propertyName()).toString() : vertex.getType())); final DynamicType modelObjectType = jaxbContext.getDynamicType(modelObjectClass); + final DynamicType reservedObjectType = jaxbContext.getDynamicType("ReservedPropNames"); for (String key : vertex.getProperties().keySet()) { DatabaseField field = getDatabaseField(key, modelObjectType); + if (field == null) { + field = getDatabaseField(key, reservedObjectType); + } if (field != null) { - if (!Metadata.isProperty(key)) { - modelVertexBuilder.property(key, vertex.getProperties().get(key)); - } + modelVertexBuilder.property(key, vertex.getProperties().get(key)); } } |