2 * Copyright © 2018 IBM Intellectual Property.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.apps.controllerblueprints.service.domain;
19 import com.fasterxml.jackson.annotation.JsonManagedReference;
20 import org.hibernate.annotations.Proxy;
21 import org.springframework.data.jpa.domain.support.AuditingEntityListener;
23 import javax.persistence.*;
24 import java.io.Serializable;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.UUID;
30 * CbaContent.java Purpose: Provide Configuration Generator for CbaContent Entity
36 @EntityListeners({AuditingEntityListener.class})
38 @Table(name = "CBA_CONTENT")
40 public class CbaContent implements Serializable {
42 private static final long serialVersionUID = 1L;
45 this.cbaUUID = UUID.randomUUID().toString();
49 @Column(name = "cba_uuid", nullable = false)
50 private String cbaUUID;
53 @Column(name = "cba_file")
54 private byte[] cbaFile;
56 @Column(name = "cba_name")
57 private String cbaName;
59 @Column(name = "cba_version")
60 private String cbaVersion;
62 @Column(name = "cba_state")
65 @Column(name="cba_description")
66 private String cbaDescription;
68 @OneToMany(mappedBy = "configModelCBA", fetch = FetchType.EAGER, orphanRemoval = true, cascade = CascadeType.ALL)
70 private List<ConfigModel> models = new ArrayList<>();
72 public String getCbaUUID() {
76 public void setCbaUUID(String cbaUUID) {
77 this.cbaUUID = cbaUUID;
80 public String getCbaName() {
84 public void setCbaName(String cbaName) {
85 this.cbaName = cbaName;
88 public String getCbaVersion() {
92 public void setCbaVersion(String cbaVersion) {
93 this.cbaVersion = cbaVersion;
96 public List<ConfigModel> getModels() {
100 public void setModels(List<ConfigModel> models) { this.models = models; }
102 public int getCbaState() { return cbaState; }
104 public void setCbaState(int cbaState) { this.cbaState = cbaState; }
106 public String getCbaDescription() { return cbaDescription; }
108 public void setCbaDescription(String cbaDescription) { this.cbaDescription = cbaDescription; }
110 public byte[] getCbaFile() { return cbaFile; }
112 public void setCbaFile(byte[] cbaFile) { this.cbaFile = cbaFile; }