-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackupMetadata.java
More file actions
42 lines (32 loc) · 963 Bytes
/
Copy pathBackupMetadata.java
File metadata and controls
42 lines (32 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.crimeLink.analyzer.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Entity
@Table(name = "backup_metadata")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BackupMetadata {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "filename", nullable = false, unique = true, length = 255)
private String filename;
@Column(name = "size_bytes")
private Long sizeBytes;
@Column(name = "created_at", nullable = false)
private LocalDateTime createdAt;
@Column(name = "created_by", length = 100)
private String createdBy;
@Column(name = "status", length = 50)
private String status; // SUCCESS, FAILED
@PrePersist
public void prePersist() {
if (createdAt == null) {
createdAt = LocalDateTime.now();
}
}
}