2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
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=========================================================
21 package org.onap.vid.model;
23 import org.onap.portalsdk.core.domain.support.DomainVo;
25 import javax.persistence.*;
26 import java.io.Serializable;
27 import java.util.Date;
31 @Table(name = "vid_category_parameter_option")
32 public class CategoryParameterOption extends DomainVo {
37 private CategoryParameter categoryParameter;
39 public CategoryParameterOption() {
42 public CategoryParameterOption(String appId, String name, CategoryParameter categoryParameter) {
45 setCategoryParameter(categoryParameter);
49 @GeneratedValue(strategy = GenerationType.IDENTITY)
50 @Column(name = "CATEGORY_OPT_DB_ID")
55 @Column(name = "CATEGORY_OPT_APP_ID")
56 public String getAppId() {
60 public void setAppId(String appId) {
64 @Column(name = "NAME")
65 public String getName() {
69 public void setName(String name) {
74 @JoinColumn(name="CATEGORY_ID", nullable=false)
75 public CategoryParameter getCategoryParameter() {
76 return categoryParameter;
79 public void setCategoryParameter(CategoryParameter categoryParameter) {
80 this.categoryParameter = categoryParameter;
84 @Column(name = "CREATED_DATE")
85 public Date getCreated() {
86 return super.getCreated();
90 @Column(name = "MODIFIED_DATE")
91 public Date getModified() {
92 return super.getModified();
97 public Long getCreatedId() {
98 return super.getCreatedId();
103 public Long getModifiedId() {
104 return super.getModifiedId();
109 public Serializable getAuditUserId() {
110 return super.getAuditUserId();
115 public Long getRowNum() {
116 return super.getRowNum();
121 public Set getAuditTrail() {
122 return super.getAuditTrail();
126 public boolean equals(Object o) {
127 if (this == o) return true;
128 if (o == null || getClass() != o.getClass()) return false;
130 CategoryParameterOption that = (CategoryParameterOption) o;
132 if (getAppId() != null ? !getAppId().equals(that.getAppId()) : that.getAppId() != null) return false;
133 if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) return false;
134 return getCategoryParameter() != null ? getCategoryParameter().equals(that.getCategoryParameter()) : that.getCategoryParameter() == null;
138 public int hashCode() {
139 int result = getAppId() != null ? getAppId().hashCode() : 0;
140 result = 31 * result + (getName() != null ? getName().hashCode() : 0);
141 result = 31 * result + (getCategoryParameter() != null ? getCategoryParameter().hashCode() : 0);
146 public String toString() {
147 return "CategoryParameterOption{" +
149 ", key='" + appId + '\'' +
150 ", value='" + name + '\'' +
151 ", categoryParameterId=" + categoryParameter.getId() +