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;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.PrePersist;
32 import javax.persistence.Table;
33 import javax.persistence.Temporal;
34 import javax.persistence.TemporalType;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
40 import com.fasterxml.jackson.annotation.JsonInclude;
41 import com.fasterxml.jackson.annotation.JsonInclude.Include;
42 import com.openpojo.business.annotation.BusinessKey;
45 * persist the request identifiers created when MSO POSTs a request to PINC
56 @JsonInclude(Include.NON_NULL)
57 @Table(name = "request_processing_data")
58 public class RequestProcessingData implements Serializable{
63 private static final long serialVersionUID = -3497593687393936143L;
66 @GeneratedValue(strategy = GenerationType.IDENTITY)
71 @Column(name = "SO_REQUEST_ID", length=50, unique=true)
72 private String soRequestId;
75 @Column(name = "GROUPING_ID", length=100, unique=true)
76 private String groupingId;
79 @Column(name = "NAME", length=200)
82 @Column(name = "VALUE", columnDefinition = "LONGTEXT")
86 @Column(name = "TAG", length=200)
89 @Column(name = "CREATE_TIME", insertable = false, updatable = false)
90 @Temporal(TemporalType.TIMESTAMP)
91 private Date created = null;
94 public boolean equals(final Object other) {
95 if (!(other instanceof RequestProcessingData)) {
98 RequestProcessingData castOther = (RequestProcessingData) other;
99 return new EqualsBuilder().append(soRequestId, castOther.soRequestId).append(groupingId, castOther.groupingId)
100 .append(name, castOther.name).append(tag, castOther.tag).isEquals();
104 public int hashCode() {
105 return new HashCodeBuilder().append(soRequestId).append(groupingId).append(name).append(tag).toHashCode();
109 public String toString() {
110 return new ToStringBuilder(this).append("id", id).append("soRequestId", soRequestId)
111 .append("groupingId", groupingId).append("name", name).append("value", value).append("tag", tag)
116 protected void createdAt() {
117 this.created = new Date();
120 public Integer getId() {
124 public void setId(Integer id) {
128 public String getSoRequestId() {
132 public void setSoRequestId(String soRequestId) {
133 this.soRequestId = soRequestId;
136 public String getGroupingId() {
140 public void setGroupingId(String groupingId) {
141 this.groupingId = groupingId;
144 public String getName() {
148 public void setName(String name) {
152 public String getValue() {
156 public void setValue(String value) {
160 public String getTag() {
164 public void setTag(String tag) {
168 public Date getCreated() {