X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-impl%2Fguard%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fguard%2FOperationsHistory.java;h=fc36265d5b256182c2297540678963cf2112ab0f;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=7354fff5dd86abb68237d202ce69a5e4edcb8f3b;hpb=bc844cbeaad034f3f5c143be8e9da7fb16d2e99f;p=policy%2Fmodels.git diff --git a/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java b/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java index 7354fff5d..fc36265d5 100644 --- a/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java +++ b/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021, 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,27 +23,38 @@ package org.onap.policy.guard; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Index; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import java.io.Serial; import java.io.Serializable; import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Index; -import javax.persistence.Table; import lombok.Data; @Entity -@Table(name = "operationshistory", - indexes = {@Index(name = "operationshistory_clreqid_index", columnList = "closedLoopName,requestId"), - @Index(name = "operationshistory_target_index", columnList = "target,operation,actor")}) +@Table(name = "operationshistory", indexes = { + @Index(name = "operationshistory_clreqid_index", columnList = "requestId,closedLoopName"), + @Index(name = "operationshistory_target_index", columnList = "target,operation,actor,endtime") +}) @Data public class OperationsHistory implements Serializable { + @Serial private static final long serialVersionUID = -551420180714993577L; @Id - @GeneratedValue + @GeneratedValue(strategy = GenerationType.TABLE, generator = "opHistoryIdGen") + @TableGenerator( + name = "opHistoryIdGen", + table = "ophistory_id_sequence", + pkColumnName = "SEQ_NAME", + valueColumnName = "SEQ_COUNT", + pkColumnValue = "SEQ_GEN") @Column(name = "id") private Long id;