-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathPosts.java
More file actions
48 lines (37 loc) · 886 Bytes
/
Posts.java
File metadata and controls
48 lines (37 loc) · 886 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
48
package com.example.devSns.entities;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.time.LocalDateTime;
@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Posts {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotNull
@Column
private String content;
@JoinColumn(name = "users_id")
@ManyToOne
@NotNull
private Users users;
@Column
private int likeit;
@Column
private LocalDateTime createat;
@Column
private LocalDateTime updateat;
public void setCreateat(LocalDateTime createat) {
this.createat = createat;
}
public void setUpdateat(LocalDateTime updateat) {
this.updateat = updateat;
}
public void setContent(String content) {
this.content = content;
}
}