diff options
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.java | 29 |
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(); } } |