2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.so.db.request.beans;
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.GenerationType;
29 import javax.persistence.Id;
30 import javax.persistence.PrePersist;
31 import javax.persistence.Table;
32 import javax.persistence.Temporal;
33 import javax.persistence.TemporalType;
34 import org.apache.commons.lang3.builder.EqualsBuilder;
35 import org.apache.commons.lang3.builder.HashCodeBuilder;
36 import org.apache.commons.lang3.builder.ToStringBuilder;
37 import com.fasterxml.jackson.annotation.JsonInclude;
38 import com.fasterxml.jackson.annotation.JsonInclude.Include;
39 import com.openpojo.business.annotation.BusinessKey;
42 * persist the request identifiers created when MSO POSTs a request to PINC <br>
52 @JsonInclude(Include.NON_NULL)
53 @Table(name = "request_processing_data")
54 public class RequestProcessingData implements Serializable {
59 private static final long serialVersionUID = -3497593687393936143L;
62 @GeneratedValue(strategy = GenerationType.IDENTITY)
67 @Column(name = "SO_REQUEST_ID", length = 50, unique = true)
68 private String soRequestId;
71 @Column(name = "GROUPING_ID", length = 100, unique = true)
72 private String groupingId;
75 @Column(name = "NAME", length = 200)
78 @Column(name = "VALUE", columnDefinition = "LONGTEXT")
82 @Column(name = "TAG", length = 200)
85 @Column(name = "CREATE_TIME", insertable = false, updatable = false)
86 @Temporal(TemporalType.TIMESTAMP)
87 private Date created = null;
89 @Column(name = "IS_DATA_INTERNAL")
90 private Boolean isDataInternal = true;
93 public boolean equals(final Object other) {
94 if (!(other instanceof RequestProcessingData)) {
97 RequestProcessingData castOther = (RequestProcessingData) other;
98 return new EqualsBuilder().append(soRequestId, castOther.soRequestId).append(groupingId, castOther.groupingId)
99 .append(name, castOther.name).append(tag, castOther.tag).isEquals();
103 public int hashCode() {
104 return new HashCodeBuilder().append(soRequestId).append(groupingId).append(name).append(tag).toHashCode();
108 public String toString() {
109 return new ToStringBuilder(this).append("id", id).append("soRequestId", soRequestId)
110 .append("groupingId", groupingId).append("name", name).append("value", value).append("tag", tag)
111 .append("isDataInternal", isDataInternal).toString();
115 protected void createdAt() {
116 this.created = new Date();
119 public Integer getId() {
123 public void setId(Integer id) {
127 public String getSoRequestId() {
131 public void setSoRequestId(String soRequestId) {
132 this.soRequestId = soRequestId;
135 public String getGroupingId() {
139 public void setGroupingId(String groupingId) {
140 this.groupingId = groupingId;
143 public String getName() {
147 public void setName(String name) {
151 public String getValue() {
155 public void setValue(String value) {
159 public String getTag() {
163 public void setTag(String tag) {
167 public Date getCreated() {
171 public Boolean getIsDataInternal() {
172 return isDataInternal;
175 public void setIsDataInternal(Boolean isDataInternal) {
176 this.isDataInternal = isDataInternal;