aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-06-29 16:48:07 -0400
committerJim Hahn <jrh3@att.com>2021-06-29 17:08:10 -0400
commit749ee9da67d32ca8e33169607fcd7139632b29e7 (patch)
treec8d3fc059b663e6215bec8a347fe4cbb0117e686 /integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java
parentfbaec67cb146add874f2aedeb5ba624f74e62d5e (diff)
Address sonars in common
Fixed: - use "var" - duplicate code block Issue-ID: POLICY-3284 Change-Id: I8cd7f2588353a2e7702c90d37d7b9f972634dca9 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java')
-rw-r--r--integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java29
1 files changed, 3 insertions, 26 deletions
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java
index ad1ef365..13595028 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/jpa/ForwardProgressEntity.java
@@ -20,8 +20,6 @@
package org.onap.policy.common.im.jpa;
-import java.io.Serializable;
-import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -29,18 +27,11 @@ 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;
-/*
- * The Entity class to persist a policy object ForwardProgress
- */
-import org.onap.policy.common.im.MonitorTime;
@Entity
@Table(name = "ForwardProgressEntity")
@@ -50,7 +41,7 @@ import org.onap.policy.common.im.MonitorTime;
@Getter
@Setter
@NoArgsConstructor
-public class ForwardProgressEntity implements Serializable {
+public class ForwardProgressEntity extends DateEntity {
private static final long serialVersionUID = 1L;
@Id
@@ -66,27 +57,13 @@ public class ForwardProgressEntity implements Serializable {
@Column(name = "fpc_count", nullable = false)
private long fpcCount;
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "created_date", updatable = false)
- private Date createdDate;
-
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "last_updated")
- private Date lastUpdated;
-
/**
* PrePersist callback method.
*/
@PrePersist
+ @Override
public void prePersist() {
- var date = MonitorTime.getInstance().getDate();
- this.createdDate = date;
- this.lastUpdated = date;
this.fpcCount = 0;
- }
-
- @PreUpdate
- public void preUpdate() {
- this.lastUpdated = MonitorTime.getInstance().getDate();
+ super.prePersist();
}
}