From 86f04e1d55b54a1a23bb274d211c6fca85980fef Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 2 Apr 2019 22:54:57 -0400 Subject: fix catalogdb cvfnc customization Hibernate entities were all wrong and needed a complete rewrite. The scope kept growing and ended up touching a lot more of the code than originally planned. These changes make the db interactions much easier and more straightforward from java. The flyway script order had to change to make this migration possible. Change-Id: I6ce363a385661300eddb11923ac6a80538edaddc Issue-ID: SO-1710 Signed-off-by: Benjamin, Max (mb388a) --- .../main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java | 1 - .../src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java | 4 ++-- .../main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java | 2 +- .../main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'adapters/mso-openstack-adapters/src/main/java/org/onap') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index 2e8c7990db..73e7143ae3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -1315,7 +1315,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { networkResource = nrc.getNetworkResource(); } } - String mode = ""; if (networkResource != null) { logger.debug("Got Network definition from Catalog: {}", networkResource.toString()); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index b99e34eb9d..6e9656a213 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -876,7 +876,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { logger.debug("version: {}", vfVersion); if (useMCUuid) { // 1707 - db refactoring - vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(mcu); + vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(mcu); if(vfmc != null) vf=vfmc.getVfModule(); else @@ -1638,7 +1638,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { VfModule vf = null; VfModuleCustomization vfmc = null; if (useMCUuid){ - vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid); + vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); vf = vfmc != null ? vfmc.getVfModule() : null; if (vf == null) { logger.debug("Unable to find a vfModule matching modelCustomizationUuid={}", mcu); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index a07fff024b..dc695615cb 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -640,7 +640,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { VfModuleCustomization vfmc = null; try { - vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid); + vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); if (vfmc == null) { String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 0dad10b5cc..584c934843 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -681,7 +681,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { VfModuleCustomization vfModuleCust = null; try { - vfModuleCust = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid); + vfModuleCust = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); if (vfModuleCust == null) { String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" -- cgit 1.2.3-korg