Skip to content

Commit a7e776a

Browse files
committed
refactor: Report 엔티티 클래스가 BaseEntity 클래스를 상속하도록 변경, Column 어노테이션 추가
1 parent aeff9ee commit a7e776a

File tree

1 file changed

+8
-11
lines changed
  • src/main/java/com/example/log4u/domain/reports/entity

1 file changed

+8
-11
lines changed
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package com.example.log4u.domain.reports.entity;
22

3-
import java.time.LocalDateTime;
4-
5-
import org.springframework.data.annotation.CreatedDate;
6-
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
7-
3+
import com.example.log4u.common.entity.BaseEntity;
84
import com.example.log4u.domain.reports.reportTargetType.ReportTargetType;
95
import com.example.log4u.domain.reports.reportType.ReportType;
106

7+
import jakarta.persistence.Column;
118
import jakarta.persistence.Entity;
12-
import jakarta.persistence.EntityListeners;
139
import jakarta.persistence.EnumType;
1410
import jakarta.persistence.Enumerated;
1511
import jakarta.persistence.GeneratedValue;
@@ -27,24 +23,25 @@
2723
@AllArgsConstructor(access = AccessLevel.PACKAGE)
2824

2925
@Entity
30-
@EntityListeners(AuditingEntityListener.class)
31-
public class Report {
26+
public class Report extends BaseEntity {
3227
@Id
3328
@GeneratedValue(strategy = GenerationType.IDENTITY)
3429
private Long id;
3530

31+
@Column(nullable = false)
3632
private Long reporterId;
3733

34+
@Column(nullable = false)
3835
@Enumerated(EnumType.STRING)
3936
private ReportTargetType reportTargetType;
4037

38+
@Column(nullable = false)
4139
@Enumerated(EnumType.STRING)
4240
private ReportType reportType;
4341

42+
@Column(nullable = false)
4443
private Long reportTargetId;
4544

45+
@Column(nullable = false)
4646
private String content;
47-
48-
@CreatedDate
49-
private LocalDateTime createdAt;
5047
}

0 commit comments

Comments
 (0)