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.HashCodeBuilder;
37 import org.apache.commons.lang3.builder.EqualsBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
40 import com.openpojo.business.annotation.BusinessKey;
43 * persist the request identifiers created when MSO POSTs a request to PINC
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;
90 public boolean equals(final Object other) {
91 if (!(other instanceof RequestProcessingData)) {
94 RequestProcessingData castOther = (RequestProcessingData) other;
95 return new EqualsBuilder().append(soRequestId, castOther.soRequestId).append(groupingId, castOther.groupingId)
96 .append(name, castOther.name).append(tag, castOther.tag).isEquals();
100 public int hashCode() {
101 return new HashCodeBuilder().append(soRequestId).append(groupingId).append(name).append(tag).toHashCode();
105 public String toString() {
106 return new ToStringBuilder(this).append("id", id).append("soRequestId", soRequestId)
107 .append("groupingId", groupingId).append("name", name).append("value", value).append("tag", tag)
112 protected void createdAt() {
113 this.created = new Date();
116 public Integer getId() {
120 public void setId(Integer id) {
124 public String getSoRequestId() {
128 public void setSoRequestId(String soRequestId) {
129 this.soRequestId = soRequestId;
132 public String getGroupingId() {
136 public void setGroupingId(String groupingId) {
137 this.groupingId = groupingId;
140 public String getName() {
144 public void setName(String name) {
148 public String getValue() {
152 public void setValue(String value) {
156 public String getTag() {
160 public void setTag(String tag) {
164 public Date getCreated() {