2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright 2019 China Mobile
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.onap.datalake.feeder.domain;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.FetchType;
28 import javax.persistence.Id;
29 import javax.persistence.OneToMany;
30 import javax.persistence.Table;
36 * Domain class representing unique topic names
44 @Table(name = "topic_name")
45 public class TopicName {
47 @Column(name = "`id`")
48 private String id;//topic name
51 @OneToMany(fetch = FetchType.LAZY, mappedBy = "topicName")
52 protected Set<PortalDesign> designs;
55 @OneToMany(fetch = FetchType.LAZY, mappedBy = "topicName")
56 protected Set<Topic> topics;
61 public TopicName(String name) {
66 public String toString() {
67 return "TopicName "+ id;
71 public boolean equals(Object obj) {
75 if (this.getClass() != obj.getClass())
78 return id.equals(((TopicName) obj).getId());
82 public int hashCode() {