summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java14
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceInfo.java5
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceInfoRepository.java33
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java15
4 files changed, 16 insertions, 51 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
index 0d7a6dbd1f..3f3742f699 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
@@ -139,6 +139,9 @@ public class Service implements Serializable {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "service")
private List<ServiceArtifact> serviceArtifactList;
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "service")
+ private List<ServiceInfo> serviceInfos;
+
@Column(name = "NAMING_POLICY")
private String namingPolicy;
@@ -385,6 +388,17 @@ public class Service implements Serializable {
this.serviceArtifactList = serviceArtifactList;
}
+ public List<ServiceInfo> getServiceInfos() {
+ if (serviceInfos == null) {
+ serviceInfos = new ArrayList<>();
+ }
+ return serviceInfos;
+ }
+
+ public void setServiceInfos(List<ServiceInfo> serviceInfos) {
+ this.serviceInfos = serviceInfos;
+ }
+
public String getWorkloadContext() {
return this.workloadContext;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceInfo.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceInfo.java
index f9c95767f6..d11a112c80 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceInfo.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceInfo.java
@@ -45,9 +45,8 @@ public class ServiceInfo implements Serializable {
@Column(name = "SERVICE_PROPERTIES")
private String serviceProperties;
- @OneToOne(cascade = CascadeType.ALL)
- @JoinTable(name = "service_to_service_info", joinColumns = @JoinColumn(name = "SERVICE_INFO_ID"),
- inverseJoinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"))
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "SERVICE_MODEL_UUID")
private Service service;
public Integer getId() {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceInfoRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceInfoRepository.java
deleted file mode 100644
index e3a4ca264e..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceInfoRepository.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (c) 2019, CMCC Technologies Co., Ltd.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.repository;
-
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.ServiceInfo;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.rest.core.annotation.RepositoryRestResource;
-
-@RepositoryRestResource(collectionResourceRel = "serviceInfo", path = "serviceInfo")
-public interface ServiceInfoRepository extends JpaRepository<ServiceInfo, Integer> {
-
- ServiceInfo findByService(Service service);
-
-}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
index ec4e922c8f..65cbb5253e 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
@@ -39,7 +39,6 @@ public class ServiceMacroHolder implements Serializable {
private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations;
private ArrayList<VnfResourceCustomization> vnfResourceCustomizations;
private ArrayList<ServiceProxyResourceCustomization> serviceProxyResourceCustomizations;
- private ServiceInfo serviceInfo;
public ServiceMacroHolder() {
@@ -50,7 +49,6 @@ public class ServiceMacroHolder implements Serializable {
this.allottedResourceCustomizations = new ArrayList<>();
this.vnfResourceCustomizations = new ArrayList<>();
this.serviceProxyResourceCustomizations = new ArrayList<>();
- this.serviceInfo = null;
}
public ServiceMacroHolder(Service service) {
@@ -66,14 +64,6 @@ public class ServiceMacroHolder implements Serializable {
this.service = service;
}
- public ServiceInfo getServiceInfo() {
- return serviceInfo;
- }
-
- public void setServiceInfo(ServiceInfo serviceInfo) {
- this.serviceInfo = serviceInfo;
- }
-
public void setVnfResources(ArrayList<VnfResource> vnfResources) {
this.vnfResources = vnfResources;
}
@@ -165,11 +155,6 @@ public class ServiceMacroHolder implements Serializable {
} else {
sb.append("service: null");
}
- if (this.serviceInfo != null) {
- sb.append("serviceInfo: " + this.serviceInfo.toString());
- } else {
- sb.append("serviceInfo: null");
- }
if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) {
int i = 0;
sb.append("VnfResources: ");