diff options
Diffstat (limited to 'integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java')
-rw-r--r-- | integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java index 494931d2..b03ec71b 100644 --- a/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java +++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/StateManagementEntity.java @@ -2,7 +2,8 @@ * ============LICENSE_START======================================================= * Integrity Monitor * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,38 +21,37 @@ package org.onap.policy.common.im.jpa; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreUpdate; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +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.GenerationType; -import javax.persistence.Id; -import javax.persistence.NamedQuery; -import javax.persistence.PrePersist; -import javax.persistence.PreUpdate; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; import lombok.AccessLevel; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; import org.onap.policy.common.im.MonitorTime; @Entity @Table(name = "StateManagementEntity") @NamedQuery(name = "StateManagementEntity.findAll", query = "SELECT e FROM StateManagementEntity e") -// @SequenceGenerator(name="seqSM", initialValue=1, allocationSize=1) - @Getter @Setter - +@NoArgsConstructor public class StateManagementEntity implements Serializable { + @Serial private static final long serialVersionUID = 1L; @Id - // @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqSM") @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") @Getter(AccessLevel.NONE) @@ -82,10 +82,6 @@ public class StateManagementEntity implements Serializable { @Column(name = "modifiedDate", nullable = false) private Date modifiedDate; - public StateManagementEntity() { - // default constructor - } - @PrePersist public void prePersist() { this.createdDate = MonitorTime.getInstance().getDate(); @@ -104,7 +100,7 @@ public class StateManagementEntity implements Serializable { * @return a new StateManagementEntity */ public static StateManagementEntity clone(StateManagementEntity sm) { - StateManagementEntity newStateManagementEntity = new StateManagementEntity(); + var newStateManagementEntity = new StateManagementEntity(); newStateManagementEntity.setResourceName(sm.getResourceName()); newStateManagementEntity.setAdminState(sm.getResourceName()); newStateManagementEntity.setOpState(sm.getOpState()); |