diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2019-04-20 15:41:18 +0530 |
---|---|---|
committer | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-26 06:17:58 +0000 |
commit | 9797ba0f3aa46ee9267f6e8de1d7f871464f4b99 (patch) | |
tree | 7bd4b12d7391cbc58ba3698f75d1c1410f39b682 /mso-catalog-db/src/main/java | |
parent | 046eb620661451d3d62638d5253d3e112f565d1a (diff) |
Enhancement for query
Enhancemenv for query to include group and vnfccustomization.
{
"serviceResources": {
"modelInfo": {
"modelName": "NSService",
"modelUuid": "0bad8c92-7d22-49f0-b092-b64e6ca564a7",
"modelInvariantUuid": "69161960-515b-4bf3-91f1-313b813f5e1d",
"modelVersion": "1.0"
},
"serviceType": "",
"serviceRole": "",
"environmentContext": "General_Revenue-Bearing",
"resourceOrder": "NF",
"workloadContext": "Production",
"serviceVnfs": [
{
"modelInfo": {
"modelName": "",
"modelUuid": "123",
"modelInvariantUuid": "",
"modelVersion": "",
"modelCustomizationUuid": "1234",
"modelInstanceName": "test"
},
"toscaNodeType": "",
"nfFunction": "",
"nfType": "",
"nfRole": "",
"nfNamingCode": "",
"multiStageDesign": "",
"resourceInput": "",
"vfModules": [],
"groups": [
{
"modelInfo": {
"modelName": "test",
"modelUuid": "11",
"modelInvariantUuid": "11",
"modelVersion": "2"
},
"vnfcs": [
{
"modelInfo": {
"modelName": "xfs",
"modelUuid": "22",
"modelInvariantUuid": "2222",
"modelVersion": "22222",
"modelCustomizationUuid": "2222"
}
}
]
}
]
}
],
"serviceNetworks": [],
"serviceAllottedResources": []
}
}
Issue-ID: SO-1393
Change-Id: Iee7f79337f73276f857d6d42b5b2416e4e8f4536
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java | 31 | ||||
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java | 14 |
2 files changed, 37 insertions, 8 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java index a7a31dcf89..413efaf12c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019 Huawei Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,23 +21,25 @@ package org.onap.so.db.catalog.beans; -import java.io.Serializable; -import java.util.Date; -import java.util.List; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.openpojo.business.annotation.BusinessKey; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.openpojo.business.annotation.BusinessKey; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.ToStringBuilder; +import java.io.Serializable; +import java.util.Date; +import java.util.List; @Entity @Table(name = "vnfc_customization") @@ -81,6 +84,10 @@ public class VnfcCustomization implements Serializable { @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization") private List<CvnfcCustomization> cvnfcCustomization; + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VNFC_INSTANCE_GROUP_CUSTOMIZATION_ID") + private VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization; + @Override public boolean equals(final Object other) { if (!(other instanceof VnfcCustomization)) { @@ -190,6 +197,14 @@ public class VnfcCustomization implements Serializable { this.cvnfcCustomization = cvnfcCustomization; } + public VnfcInstanceGroupCustomization getVnfcInstanceGroupCustomization() { + return vnfcInstanceGroupCustomization; + } + + public void setVnfcInstanceGroupCustomization(VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization) { + this.vnfcInstanceGroupCustomization = vnfcInstanceGroupCustomization; + } + public String getResourceInput() { return resourceInput; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java index 695e5bbbb9..8a00ccd261 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019 Huawei Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +23,7 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; +import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,6 +34,7 @@ import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; @@ -66,6 +69,9 @@ public class VnfcInstanceGroupCustomization implements Serializable { @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") private InstanceGroup instanceGroup; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "vnfcInstanceGroupCustomization") + private List<VnfcCustomization> vnfcCustomizations; + @Column(name = "FUNCTION") private String function; @@ -150,4 +156,12 @@ public class VnfcInstanceGroupCustomization implements Serializable { public void setInstanceGroup(InstanceGroup instanceGroup) { this.instanceGroup = instanceGroup; } + + public List<VnfcCustomization> getVnfcCustomizations() { + return vnfcCustomizations; + } + + public void setVnfcCustomizations(List<VnfcCustomization> vnfcCustomizations) { + this.vnfcCustomizations = vnfcCustomizations; + } } |