| 36305 |
amit |
1 |
package com.spice.profitmandi.dao.entity.transaction;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.dao.enumuration.transaction.CronBatchStatus;
|
|
|
4 |
|
|
|
5 |
import javax.persistence.*;
|
|
|
6 |
import java.time.LocalDateTime;
|
|
|
7 |
|
|
|
8 |
@Entity
|
|
|
9 |
@Table(name = "transaction.cron_batch")
|
|
|
10 |
public class CronBatch {
|
|
|
11 |
|
|
|
12 |
@Id
|
|
|
13 |
@Column(name = "id", unique = true, updatable = false)
|
|
|
14 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
15 |
private int id;
|
|
|
16 |
|
|
|
17 |
@Column(name = "job_name")
|
|
|
18 |
private String jobName;
|
|
|
19 |
|
|
|
20 |
@Enumerated(EnumType.STRING)
|
|
|
21 |
@Column(name = "status")
|
|
|
22 |
private CronBatchStatus status;
|
|
|
23 |
|
|
|
24 |
@Column(name = "total_count")
|
|
|
25 |
private int totalCount;
|
|
|
26 |
|
|
|
27 |
@Column(name = "success_count")
|
|
|
28 |
private int successCount;
|
|
|
29 |
|
|
|
30 |
@Column(name = "failure_count")
|
|
|
31 |
private int failureCount;
|
|
|
32 |
|
|
|
33 |
@Column(name = "started_at")
|
|
|
34 |
private LocalDateTime startedAt;
|
|
|
35 |
|
|
|
36 |
@Column(name = "completed_at")
|
|
|
37 |
private LocalDateTime completedAt;
|
|
|
38 |
|
|
|
39 |
public CronBatch() {}
|
|
|
40 |
|
|
|
41 |
public CronBatch(String jobName) {
|
|
|
42 |
this.jobName = jobName;
|
|
|
43 |
this.status = CronBatchStatus.RUNNING;
|
|
|
44 |
this.startedAt = LocalDateTime.now();
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
public int getId() { return id; }
|
|
|
48 |
|
|
|
49 |
public String getJobName() { return jobName; }
|
|
|
50 |
public void setJobName(String jobName) { this.jobName = jobName; }
|
|
|
51 |
|
|
|
52 |
public CronBatchStatus getStatus() { return status; }
|
|
|
53 |
public void setStatus(CronBatchStatus status) { this.status = status; }
|
|
|
54 |
|
|
|
55 |
public int getTotalCount() { return totalCount; }
|
|
|
56 |
public void setTotalCount(int totalCount) { this.totalCount = totalCount; }
|
|
|
57 |
|
|
|
58 |
public int getSuccessCount() { return successCount; }
|
|
|
59 |
public void setSuccessCount(int successCount) { this.successCount = successCount; }
|
|
|
60 |
|
|
|
61 |
public int getFailureCount() { return failureCount; }
|
|
|
62 |
public void setFailureCount(int failureCount) { this.failureCount = failureCount; }
|
|
|
63 |
|
|
|
64 |
public LocalDateTime getStartedAt() { return startedAt; }
|
|
|
65 |
public void setStartedAt(LocalDateTime startedAt) { this.startedAt = startedAt; }
|
|
|
66 |
|
|
|
67 |
public LocalDateTime getCompletedAt() { return completedAt; }
|
|
|
68 |
public void setCompletedAt(LocalDateTime completedAt) { this.completedAt = completedAt; }
|
|
|
69 |
}
|