2023-04-11 16:41:01 +02:00
|
|
|
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
|
2023-06-13 14:57:39 +02:00
|
|
|
public int id;
|
2023-04-11 16:41:01 +02:00
|
|
|
|
|
|
|
@Column(name = "base_url")
|
|
|
|
public String baseUrl;
|
2023-06-29 11:00:26 +02:00
|
|
|
|
2023-04-11 16:41:01 +02:00
|
|
|
@Column(name="number_of_records")
|
|
|
|
public int numberOfRecords;
|
2023-06-29 11:00:26 +02:00
|
|
|
|
2023-04-11 16:41:01 +02:00
|
|
|
@Column(name="guidelines")
|
|
|
|
public String guidelines;
|
|
|
|
|
|
|
|
@Column(name="started")
|
|
|
|
public Date startDate;
|
2023-06-29 11:00:26 +02:00
|
|
|
|
2023-04-11 16:41:01 +02:00
|
|
|
@Column(name="ended")
|
|
|
|
public Date endDate;
|
|
|
|
|
|
|
|
@Column(name = "records_tested")
|
|
|
|
public int recordsTested;
|
2023-06-20 14:42:16 +02:00
|
|
|
|
2023-06-13 14:57:39 +02:00
|
|
|
@Column(name="progress")
|
|
|
|
public String progress; //stopped, completed, in progress
|
2023-06-20 14:42:16 +02:00
|
|
|
|
2023-06-13 14:57:39 +02:00
|
|
|
@Column(name="status")
|
|
|
|
public String status; //success, failure
|
2023-06-20 14:42:16 +02:00
|
|
|
|
2023-04-11 16:41:01 +02:00
|
|
|
@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;
|
2023-06-20 14:42:16 +02:00
|
|
|
this.progress = "IN_PROGRESS";
|
2023-04-11 16:41:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2023-06-13 14:57:39 +02:00
|
|
|
return "ValidationJob{" +
|
2023-04-11 16:41:01 +02:00
|
|
|
"id=" + id +
|
|
|
|
", baseUrl='" + baseUrl + '\'' +
|
|
|
|
", numberOfRecords=" + numberOfRecords +
|
|
|
|
", guidelines='" + guidelines + '\'' +
|
|
|
|
", startDate=" + startDate +
|
|
|
|
", endDate=" + endDate +
|
|
|
|
", recordsTested=" + recordsTested +
|
2023-06-13 14:57:39 +02:00
|
|
|
", progress='" + progress + '\'' +
|
2023-04-11 16:41:01 +02:00
|
|
|
", status='" + status + '\'' +
|
|
|
|
", score=" + score +
|
|
|
|
'}';
|
|
|
|
}
|
2023-06-13 14:57:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-11 16:41:01 +02:00
|
|
|
}
|