feat : timestamp 수정
This commit is contained in:
parent
dca8f9a553
commit
4ef7d81198
@ -8,6 +8,8 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
@ -41,11 +43,11 @@ public class Board {
|
||||
private int viewCount;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@CreatedDate
|
||||
@CreationTimestamp
|
||||
LocalDateTime createdAt;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@LastModifiedDate
|
||||
@UpdateTimestamp
|
||||
LocalDateTime modifiedAt;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
|
@ -9,6 +9,8 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
|
||||
@ -29,11 +31,11 @@ public class Comment {
|
||||
private String content;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@CreatedDate
|
||||
@CreationTimestamp
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@LastModifiedDate
|
||||
@UpdateTimestamp
|
||||
private LocalDateTime modifiedAt;
|
||||
|
||||
@ManyToOne
|
||||
|
@ -6,6 +6,7 @@ import com.edufocus.edufocus.user.model.entity.vo.User;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
@ -31,7 +32,7 @@ public class Report {
|
||||
private int correctCount;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@CreatedDate
|
||||
@CreationTimestamp
|
||||
private LocalDateTime testAt;
|
||||
|
||||
private Long lectureId;
|
||||
@ -48,7 +49,7 @@ public class Report {
|
||||
@JoinColumn(name = "reportset_id")
|
||||
private ReportSet reportSet;
|
||||
|
||||
@OneToMany(mappedBy = "report", cascade = CascadeType.ALL)
|
||||
@OneToMany(mappedBy = "report", cascade = CascadeType.REMOVE)
|
||||
private List<Answer> answers;
|
||||
|
||||
public ReportResponse makeReportResponse(){
|
||||
|
@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
@ -35,10 +36,10 @@ public class ReportSet {
|
||||
private UUID id;
|
||||
|
||||
@Column(columnDefinition = "TIMESTAMP")
|
||||
@CreatedDate
|
||||
@CreationTimestamp
|
||||
private LocalDateTime createAt;
|
||||
|
||||
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.ALL)
|
||||
@OneToMany(mappedBy = "reportSet", cascade = CascadeType.REMOVE)
|
||||
private List<Report> reports;
|
||||
|
||||
@ManyToOne
|
||||
|
Loading…
Reference in New Issue
Block a user