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 | 184 |
1 files changed, 98 insertions, 86 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 2ef3fa8a..24f36c56 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 @@ -40,92 +40,104 @@ import javax.persistence.TemporalType; */ @Entity -@Table(name="ForwardProgressEntity") -@NamedQueries({ - @NamedQuery(name=" ForwardProgressEntity.findAll", query="SELECT e FROM ForwardProgressEntity e "), - @NamedQuery(name="ForwardProgressEntity.deleteAll", query="DELETE FROM ForwardProgressEntity WHERE 1=1") -}) -//@SequenceGenerator(name="seqForwardProgress", initialValue=1, allocationSize=1) +@Table(name = "ForwardProgressEntity") +@NamedQueries({@NamedQuery(name = " ForwardProgressEntity.findAll", query = "SELECT e FROM ForwardProgressEntity e "), + @NamedQuery(name = "ForwardProgressEntity.deleteAll", query = "DELETE FROM ForwardProgressEntity WHERE 1=1")}) +// @SequenceGenerator(name="seqForwardProgress", initialValue=1, allocationSize=1) public class ForwardProgressEntity implements Serializable { - private static final long serialVersionUID = 1L; - - @Id - //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqForwardProgress") - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name="forwardProgressId") - private long forwardProgressId; - - @Column(name="resourceName", nullable=false, length=100, unique=true) - private String resourceName; - - @Column(name="fpc_count", nullable=false) - private long fpcCount; - - @Temporal(TemporalType.TIMESTAMP) - @Column(name="created_date", updatable=false) - private Date created_date; - - @Temporal(TemporalType.TIMESTAMP) - @Column(name="last_updated") - private Date lastUpdated; - - public ForwardProgressEntity() { - //default constructor - } - - @PrePersist - public void prePersist() { - Date date = new Date(); - this.created_date = date; - this.lastUpdated = date; - this.fpcCount = 0; - } - - @PreUpdate - public void preUpdate() { - this.lastUpdated = new Date(); - } - - /** - * @return the Id - */ - public long getForwardProgressId() { - return forwardProgressId; - } - - public String getResourceName() { - return this.resourceName; - } - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - /** - * @return the fpcCount - */ - public long getFpcCount() { - return fpcCount; - } - - /** - * @param fpcCount the fpcCount to set - */ - public void setFpcCount(long fpcCount) { - this.fpcCount = fpcCount; - } - - /** - * @return the lastUpdated - */ - public Date getLastUpdated() { - return lastUpdated; - } - - /** - * @param lastUpdated the lastUpdated to set - */ - public void setLastUpdated(Date lastUpdated) { - this.lastUpdated = lastUpdated; - } + private static final long serialVersionUID = 1L; + + @Id + // @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqForwardProgress") + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "forwardProgressId") + private long forwardProgressId; + + @Column(name = "resourceName", nullable = false, length = 100, unique = true) + private String resourceName; + + @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; + + public ForwardProgressEntity() { + // default constructor + } + + /** + * PrePersist callback method. + */ + @PrePersist + public void prePersist() { + Date date = new Date(); + this.createdDate = date; + this.lastUpdated = date; + this.fpcCount = 0; + } + + @PreUpdate + public void preUpdate() { + this.lastUpdated = new Date(); + } + + /** + * Get the forward progress Id. + * + * @return the Id + */ + public long getForwardProgressId() { + return forwardProgressId; + } + + public String getResourceName() { + return this.resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + /** + * Get the fpcCount. + * + * @return the fpcCount + */ + public long getFpcCount() { + return fpcCount; + } + + /** + * Set the fpcCount. + * + * @param fpcCount the fpcCount to set + */ + public void setFpcCount(long fpcCount) { + this.fpcCount = fpcCount; + } + + /** + * Get the lastUpdated. + * + * @return the lastUpdated + */ + public Date getLastUpdated() { + return lastUpdated; + } + + /** + * Set the lastUpdated. + * + * @param lastUpdated the lastUpdated to set + */ + public void setLastUpdated(Date lastUpdated) { + this.lastUpdated = lastUpdated; + } } |