blob: 1f0d56dd25fb6a7378e99716b68517906133acbb [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM
4 * ================================================================================
5 * Copyright (C) 2018 AT&T
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
21
22
23package org.onap.osam.model;
24
25import com.fasterxml.jackson.annotation.JsonIgnore;
26import org.onap.portalsdk.core.domain.support.DomainVo;
27
28import javax.persistence.*;
29import java.io.Serializable;
30import java.util.Date;
31import java.util.HashSet;
32import java.util.Set;
33
34@Entity
35@Table(name = "vid_vnf")
36public class VNFDao extends DomainVo {
37
38 private String vnfUUID;
39 private String vnfInvariantUUID;
40 private Set<VidWorkflow> workflows = new HashSet<>(0);
41
42 @Id
43 @GeneratedValue(strategy = GenerationType.IDENTITY)
44 @Column(name = "VNF_DB_ID")
45 @JsonIgnore
46 public Long getId() {
47 return id;
48 }
49
50 @Override
51 @Column(name = "CREATED_DATE")
52 @JsonIgnore
53 public Date getCreated() {
54 return super.getCreated();
55 }
56
57 @Override
58 @Column(name = "MODIFIED_DATE")
59 @JsonIgnore
60 public Date getModified() {
61 return super.getModified();
62 }
63
64 @Override
65 @Transient
66 @JsonIgnore
67 public Long getCreatedId() {
68 return super.getCreatedId();
69 }
70
71 @Override
72 @Transient
73 @JsonIgnore
74 public Long getModifiedId() {
75 return super.getModifiedId();
76 }
77
78 @Override
79 @Transient
80 @JsonIgnore
81 public Serializable getAuditUserId() {
82 return super.getAuditUserId();
83 }
84
85 @Override
86 @Transient
87 @JsonIgnore
88 public Long getRowNum() {
89 return super.getRowNum();
90 }
91
92 @Override
93 @Transient
94 @JsonIgnore
95 public Set getAuditTrail() {
96 return super.getAuditTrail();
97 }
98
99 @Column(name = "VNF_APP_UUID")
100 public String getVnfUUID() {
101 return vnfUUID;
102 }
103
104 @Column(name = "VNF_APP_INVARIANT_UUID")
105 public String getVnfInvariantUUID() {
106 return vnfInvariantUUID;
107 }
108
109
110 public void setVnfUUID(String vnfUUID) {
111 this.vnfUUID = vnfUUID;
112 }
113
114 public void setVnfInvariantUUID(String vnfInvariantUUID) {
115 this.vnfInvariantUUID = vnfInvariantUUID;
116 }
117
118 @ManyToMany(cascade = CascadeType.ALL, fetch =FetchType.EAGER )
119 @JoinTable(name = "vid_vnf_workflow", joinColumns = { @JoinColumn(name = "VNF_DB_ID") }, inverseJoinColumns = { @JoinColumn(name = "WORKFLOW_DB_ID") })
120 public Set<VidWorkflow> getWorkflows() {
121 return workflows;
122 }
123
124 public void setWorkflows(Set<VidWorkflow> workflows) {
125 this.workflows = workflows;
126 }
127}