feat qna수정
This commit is contained in:
commit
e8b75b671f
@ -9,6 +9,8 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
|||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.hibernate.annotations.CreationTimestamp;
|
import org.hibernate.annotations.CreationTimestamp;
|
||||||
|
import org.hibernate.annotations.OnDelete;
|
||||||
|
import org.hibernate.annotations.OnDeleteAction;
|
||||||
import org.hibernate.annotations.UpdateTimestamp;
|
import org.hibernate.annotations.UpdateTimestamp;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
import org.springframework.data.annotation.LastModifiedDate;
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
@ -59,9 +61,9 @@ public class Board {
|
|||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "lecture_id")
|
@JoinColumn(name = "lecture_id")
|
||||||
|
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||||
private Lecture lecture;
|
private Lecture lecture;
|
||||||
|
|
||||||
|
|
||||||
@OneToMany(mappedBy = "board", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "board", cascade = CascadeType.ALL)
|
||||||
private List<Comment> comments;
|
private List<Comment> comments;
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ public class ReportSet {
|
|||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "lecture_id")
|
@JoinColumn(name = "lecture_id")
|
||||||
|
@OnDelete(action = OnDeleteAction.CASCADE)
|
||||||
private Lecture lecture;
|
private Lecture lecture;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
Loading…
Reference in New Issue
Block a user