From 10cf022c9394ba4409d601012eaf6619c0302d55 Mon Sep 17 00:00:00 2001 From: "Kajur, Harish (vk250x)" Date: Sun, 7 Apr 2019 20:38:42 -0400 Subject: Fix logic in Schema Generator to properly check if indexes are needed on dbaliased properties Added test to verify indexes are created. Issue-ID: AAI-2333 Change-Id: Ib80de5cce3dfc99277d7cbd6e1a51530ff588478 Signed-off-by: Kajur, Harish (vk250x) --- aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'aai-core/src/main') diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java index e6eb1bca..c0a9e201 100644 --- a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java +++ b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java @@ -163,8 +163,8 @@ public class SchemaGenerator { String dmsg = " Index [" + dbPropName + "] already existed in the DB. "; LOGGER.debug(dmsg); } else { - if (obj.getIndexedProperties().contains(dbPropName)) { - if (obj.getUniqueProperties().contains(dbPropName)) { + if (obj.getIndexedProperties().contains(propName)) { + if (obj.getUniqueProperties().contains(propName)) { imsg = "Add Unique index for PropertyKey: [" + dbPropName + "]"; LOGGER.info(imsg); graphMgmt.buildIndex(dbPropName, Vertex.class).addKey(propK).unique() -- cgit 1.2.3-korg