diff options
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java | 3 | ||||
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java | 17 |
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; |