-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotification.java
More file actions
40 lines (31 loc) · 930 Bytes
/
Notification.java
File metadata and controls
40 lines (31 loc) · 930 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
package org.example.studylog.entity.notification;
import jakarta.persistence.*;
import lombok.*;
import org.example.studylog.entity.user.User;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
@Getter
@Setter
@Builder
@Entity
@NoArgsConstructor
@AllArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class Notification {
@Id
@GeneratedValue
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@OnDelete(action = OnDeleteAction.CASCADE)
private User user;
@Enumerated(EnumType.STRING)
private NotificationType type;
private String content;
@CreatedDate
private LocalDateTime createdAt;
@Column(nullable = false)
private boolean isRead = false;
}