Prefer default field if available 65/100065/1
authorDaniel Silverthorn <daniel.silverthorn@amdocs.com>
Tue, 7 Jan 2020 18:39:45 +0000 (13:39 -0500)
committerDaniel Silverthorn <daniel.silverthorn@amdocs.com>
Tue, 7 Jan 2020 18:44:22 +0000 (13:44 -0500)
Change-Id: Iefed13bb0ae83acc5b5accdc9d1a30f1126e2a53
Issue-ID: AAI-2743
Signed-off-by: Daniel Silverthorn <daniel.silverthorn@amdocs.com>
src/main/java/org/onap/aai/datarouter/policy/AbstractSpikeEntityEventProcessor.java

index 4aad6f2..08ebd77 100644 (file)
@@ -42,6 +42,7 @@ import org.json.JSONObject;
 import org.onap.aai.cl.api.Logger;
 import org.onap.aai.cl.eelf.LoggerFactory;
 import org.onap.aai.cl.mdc.MdcContext;
+import org.onap.aai.datarouter.util.DataRouterProperties;
 import org.onap.aai.schema.OxmModelLoader;
 import org.onap.aai.datarouter.entity.DocumentStoreDataEntity;
 import org.onap.aai.datarouter.entity.SpikeEventEntity;
@@ -461,6 +462,10 @@ public abstract class AbstractSpikeEntityEventProcessor implements Processor {
 
   private String getEntityPrimaryKeyFieldName(DynamicJAXBContext oxmJaxbContext,
       String oxmEntityType, String entityType) {
+    String defaultKey = DataRouterProperties.get("entity.primary.field");
+    if (defaultKey != null) {
+      return defaultKey;
+    }
 
     DynamicType entity = oxmJaxbContext.getDynamicType(oxmEntityType);
     if (entity == null) {