-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBullet.java
More file actions
47 lines (36 loc) · 998 Bytes
/
Copy pathBullet.java
File metadata and controls
47 lines (36 loc) · 998 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
43
44
45
46
47
package com.crimeLink.analyzer.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
@Entity
@Table(name = "bullets")
@Data
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Bullet {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "bullet_id")
private Integer bulletId;
@Column(name = "bullet_type", nullable = false)
private String bulletType;
@Column(name = "number_of_magazines", nullable = false)
private Integer numberOfMagazines;
@Column(name = "register_date", updatable = false)
private LocalDateTime registerDate;
@Column(name = "updated_date")
private LocalDateTime updatedDate;
@Column(name = "remarks")
private String remarks;
@PrePersist
void onCreate() {
registerDate = LocalDateTime.now();
updatedDate = LocalDateTime.now();
}
@PreUpdate
void onUpdate() {
updatedDate = LocalDateTime.now();
}
}