blob: d05a75ce30e87c578b394050ac465b10f9a5b704 [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
25//import org.hibernate.annotations.Table;
26
27import javax.persistence.*;
28import java.util.HashSet;
29import java.util.Set;
30
31//import javax.persistence.*;
32
33@Entity
34@Table(name = "vid_category_parameter", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
35public class CategoryParameter extends VidBaseEntity {
36
37 public enum Family {
38 PARAMETER_STANDARDIZATION,
39 TENANT_ISOLATION
40 }
41
42 private String name;
43 private boolean idSupported;
44
45 @Column(name = "FAMILY")
46 @Enumerated(EnumType.STRING)
47 private String family;
48
49 public String getFamily() {
50 return family;
51 }
52
53 public void setFamily(String family) {
54 this.family = family;
55 }
56
57 private Set<CategoryParameterOption> options = new HashSet<>(0);
58
59 @Override
60 @Id
61 @GeneratedValue(strategy = GenerationType.IDENTITY)
62 @Column(name = "CATEGORY_ID")
63 public Long getId() {
64 return super.getId();
65 }
66
67 @Column(name = "NAME", unique = true, nullable = false, length=50)
68 public String getName() {
69 return name;
70 }
71
72 public void setName(String name) {
73 this.name = name;
74 }
75
76 @OneToMany(fetch = FetchType.EAGER, mappedBy = "categoryParameter")
77 public Set<CategoryParameterOption> getOptions() {
78 return options;
79 }
80
81 public void setOptions(Set<CategoryParameterOption> options) {
82 this.options = options;
83 }
84
85 public boolean addOption(CategoryParameterOption option) {
86 return options.add(option);
87 }
88
89 @Column(name = "ID_SUPPORTED")
90 public boolean isIdSupported() {
91 return idSupported;
92 }
93
94 public void setIdSupported(boolean idSupported) {
95 this.idSupported = idSupported;
96 }
97}