2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
24 package org.onap.clamp.tosca;
26 import com.google.gson.annotations.Expose;
28 import java.io.Serializable;
29 import java.util.ArrayList;
30 import java.util.List;
32 import javax.persistence.CascadeType;
33 import javax.persistence.Column;
34 import javax.persistence.Entity;
35 import javax.persistence.FetchType;
36 import javax.persistence.Id;
37 import javax.persistence.OneToMany;
38 import javax.persistence.Table;
40 import org.onap.clamp.loop.common.AuditEntity;
43 * Represents Dictionary.
47 @Table(name = "dictionary")
48 public class Dictionary extends AuditEntity implements Serializable {
51 * The serial version id.
53 private static final long serialVersionUID = -286522707701388645L;
57 @Column(nullable = false, name = "name", unique = true)
61 @Column(name = "dictionary_second_level")
62 private int secondLevelDictionary;
65 @Column(name = "dictionary_type")
66 private String subDictionaryType;
69 @OneToMany(mappedBy = "dictionary", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
70 private List<DictionaryElement> dictionaryElements = new ArrayList<>();
77 public String getName() {
84 * @param name the name to set
86 public void setName(String name) {
91 * secondLevelDictionary getter.
93 * @return the secondLevelDictionary
95 public int getSecondLevelDictionary() {
96 return secondLevelDictionary;
100 * secondLevelDictionary setter.
102 * @param secondLevelDictionary the secondLevelDictionary to set
104 public void setSecondLevelDictionary(int secondLevelDictionary) {
105 this.secondLevelDictionary = secondLevelDictionary;
109 * subDictionaryType getter.
111 * @return the subDictionaryType
113 public String getSubDictionaryType() {
114 return subDictionaryType;
118 * subDictionaryType setter.
120 * @param subDictionaryType the subDictionaryType to set
122 public void setSubDictionaryType(String subDictionaryType) {
123 this.subDictionaryType = subDictionaryType;
127 * dictionaryElements getter.
129 * @return the dictionaryElements
131 public List<DictionaryElement> getDictionaryElements() {
132 return dictionaryElements;
136 * dictionaryElements setter.
138 * @param dictionaryElements the dictionaryElements to set
140 public void setDictionaryElements(List<DictionaryElement> dictionaryElements) {
141 this.dictionaryElements = dictionaryElements;
145 public int hashCode() {
146 final int prime = 31;
148 result = prime * result + ((name == null) ? 0 : name.hashCode());
153 public boolean equals(Object obj) {
160 if (getClass() != obj.getClass()) {
163 Dictionary other = (Dictionary) obj;
165 if (other.name != null) {
168 } else if (!name.equals(other.name)) {