Java 17 Upgrade
[policy/models.git] / models-interactions / model-impl / guard / src / main / java / org / onap / policy / guard / OperationsHistory.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * ================================================================================
5  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2021, 2023 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * SPDX-License-Identifier: Apache-2.0
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.policy.guard;
25
26 import jakarta.persistence.Column;
27 import jakarta.persistence.Entity;
28 import jakarta.persistence.GeneratedValue;
29 import jakarta.persistence.GenerationType;
30 import jakarta.persistence.Id;
31 import jakarta.persistence.Index;
32 import jakarta.persistence.Table;
33 import jakarta.persistence.TableGenerator;
34 import java.io.Serial;
35 import java.io.Serializable;
36 import java.util.Date;
37 import lombok.Data;
38
39 @Entity
40 @Table(name = "operationshistory", indexes = {
41     @Index(name = "operationshistory_clreqid_index", columnList = "requestId,closedLoopName"),
42     @Index(name = "operationshistory_target_index", columnList = "target,operation,actor,endtime")
43 })
44 @Data
45 public class OperationsHistory implements Serializable {
46
47     @Serial
48     private static final long serialVersionUID = -551420180714993577L;
49
50     @Id
51     @GeneratedValue(strategy = GenerationType.TABLE, generator = "opHistoryIdGen")
52     @TableGenerator(
53         name = "opHistoryIdGen",
54         table = "ophistory_id_sequence",
55         pkColumnName = "SEQ_NAME",
56         valueColumnName = "SEQ_COUNT",
57         pkColumnValue = "SEQ_GEN")
58     @Column(name = "id")
59     private Long id;
60
61     @Column(name = "closedLoopName", length = 255)
62     private String closedLoopName;
63
64     @Column(name = "requestId", length = 50)
65     private String requestId;
66
67     @Column(name = "subrequestId", length = 50)
68     private String subrequestId;
69
70     @Column(name = "actor", length = 50)
71     private String actor;
72
73     @Column(name = "operation", length = 50)
74     private String operation;
75
76     @Column(name = "target", length = 50)
77     private String target;
78
79     @Column(name = "starttime")
80     private Date starttime;
81
82     @Column(name = "outcome", length = 50)
83     private String outcome;
84
85     @Column(name = "message", length = 255)
86     private String message;
87
88     @Column(name = "endtime")
89     private Date endtime;
90
91 }