aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-03-13 13:26:54 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-13 13:26:54 +0000
commitc6c5958e9827e9ba5f4df8ca5862c3770116813d (patch)
tree3a7c36217a51c25294ccc678a28caa9b855805c1 /mso-catalog-db/src
parent6222fd0a63a76c7588ac7d096b8e630a6fd2343e (diff)
parentaa7e2b46bd85fd17c0981fa5a67c5c447c698a49 (diff)
Merge "Remove service recipes from service object"
Diffstat (limited to 'mso-catalog-db/src')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java17
2 files changed, 18 insertions, 2 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 e0b783fd9e..428736eddc 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
@@ -123,9 +123,8 @@ public class Service implements Serializable {
@JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
private List<PnfResourceCustomization> pnfCustomizations;
- @OneToMany(cascade = CascadeType.ALL)
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "service")
@MapKey(name = "action")
- @JoinColumn(name = "SERVICE_MODEL_UUID")
private Map<String, ServiceRecipe> recipes;
@ManyToOne(cascade = CascadeType.ALL)
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
index d063ea4809..79b27e7deb 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
@@ -23,9 +23,13 @@ package org.onap.so.db.catalog.beans;
import java.io.Serializable;
import java.util.Date;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
import javax.persistence.PrePersist;
import javax.persistence.Table;
import javax.persistence.Temporal;
@@ -74,6 +78,11 @@ public class ServiceRecipe implements Serializable, Recipe {
@Column(name = "CREATION_TIMESTAMP", updatable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date created;
+
+ @BusinessKey
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID",insertable = false, updatable = false)
+ private Service service;
@PrePersist
protected void onCreate() {
@@ -177,6 +186,14 @@ public class ServiceRecipe implements Serializable, Recipe {
public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) {
this.serviceTimeoutInterim = serviceTimeoutInterim;
}
+
+ public Service getService() {
+ return service;
+ }
+
+ public void setService(Service service) {
+ this.service = service;
+ }
public Date getCreated() {
return created;