Skip to content

Commit

Permalink
refactor(Entity) : EntityListeners 추가하여, createdAt 컬럼 null 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
mjj111 committed Jun 30, 2024
1 parent 74ba549 commit 3d31578
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/aliens/backend/board/domain/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import com.aliens.backend.board.domain.enums.BoardCategory;
import jakarta.persistence.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.Instant;
import java.util.ArrayList;
import java.util.List;

@Entity
@EntityListeners(AuditingEntityListener.class)
public class Board {

@Id
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/aliens/backend/board/domain/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import com.aliens.backend.board.domain.enums.CommentType;
import jakarta.persistence.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.Instant;

@Entity
@EntityListeners(AuditingEntityListener.class)
public class Comment {

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import com.aliens.backend.notification.controller.dto.NotificationResponse;
import jakarta.persistence.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.Instant;

@EntityListeners(AuditingEntityListener.class)
@Entity
public class Notification {

Expand Down

0 comments on commit 3d31578

Please sign in to comment.