package eu.dnetlib.validatorapi.entities; import javax.persistence.*; import java.util.Date; @Entity @Table(name = "validation_jobs") public class ValidationJob { @GeneratedValue(strategy = GenerationType.IDENTITY) @Id public int id; @Column(name = "base_url") public String baseUrl; @Column(name="number_of_records") public int numberOfRecords; @Column(name="guidelines") public String guidelines; @Column(name="started") public Date startDate; @Column(name="ended") public Date endDate; @Column(name = "records_tested") public int recordsTested; @Column(name="progress") public String progress; //stopped, completed, in progress @Column(name="status") public String status; //success, failure @Column(name="score") public double score; public ValidationJob(){ startDate = new Date(); } public ValidationJob(String baseUrl, int numberOfRecords) { this.startDate = new Date(); this.baseUrl = baseUrl; this.numberOfRecords = numberOfRecords; this.progress = "IN_PROGRESS"; } @Override public String toString() { return "ValidationJob{" + "id=" + id + ", baseUrl='" + baseUrl + '\'' + ", numberOfRecords=" + numberOfRecords + ", guidelines='" + guidelines + '\'' + ", startDate=" + startDate + ", endDate=" + endDate + ", recordsTested=" + recordsTested + ", progress='" + progress + '\'' + ", status='" + status + '\'' + ", score=" + score + '}'; } public int getId() { return id; } public void setId(int id) { this.id = id; } }