2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * SPDX-License-Identifier: Apache-2.0
21 * ============LICENSE_END=========================================================
24 package org.onap.policy.guard;
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;
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")
45 public class OperationsHistory implements Serializable {
48 private static final long serialVersionUID = -551420180714993577L;
51 @GeneratedValue(strategy = GenerationType.TABLE, generator = "opHistoryIdGen")
53 name = "opHistoryIdGen",
54 table = "ophistory_id_sequence",
55 pkColumnName = "SEQ_NAME",
56 valueColumnName = "SEQ_COUNT",
57 pkColumnValue = "SEQ_GEN")
61 @Column(name = "closedLoopName", length = 255)
62 private String closedLoopName;
64 @Column(name = "requestId", length = 50)
65 private String requestId;
67 @Column(name = "subrequestId", length = 50)
68 private String subrequestId;
70 @Column(name = "actor", length = 50)
73 @Column(name = "operation", length = 50)
74 private String operation;
76 @Column(name = "target", length = 50)
77 private String target;
79 @Column(name = "starttime")
80 private Date starttime;
82 @Column(name = "outcome", length = 50)
83 private String outcome;
85 @Column(name = "message", length = 255)
86 private String message;
88 @Column(name = "endtime")