-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] User 정책 전면 리팩토링 + 스케쥴러 설정 #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
5cf575e
a8017fc
3e77ba4
33ecd4d
b520f07
046b0cf
348732c
ad9d3ae
024c06f
d98200c
036318a
06c9771
75619db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,7 @@ | ||||||||||||
| package com.spoony.spoony_server.adapter.out.persistence.feed.db; | ||||||||||||
|
|
||||||||||||
| import java.time.LocalDateTime; | ||||||||||||
|
|
||||||||||||
| import com.spoony.spoony_server.adapter.out.persistence.post.db.PostEntity; | ||||||||||||
| import com.spoony.spoony_server.adapter.out.persistence.user.db.UserEntity; | ||||||||||||
| import jakarta.persistence.*; | ||||||||||||
|
|
@@ -11,28 +13,33 @@ | |||||||||||
| @Entity | ||||||||||||
| @Getter | ||||||||||||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||||||||||||
| @Table(name = "feed") | ||||||||||||
| @Table(name = "feed", | ||||||||||||
| uniqueConstraints = @UniqueConstraint(columnNames = {"user_id", "post_id"})) | ||||||||||||
| public class FeedEntity { | ||||||||||||
| @Id | ||||||||||||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||||||||||||
| private Long feedId; | ||||||||||||
|
|
||||||||||||
| @ManyToOne(fetch = FetchType.LAZY) | ||||||||||||
| @JoinColumn(name = "user_id") | ||||||||||||
| @JoinColumn(name = "user_id", nullable = false) | ||||||||||||
| private UserEntity user; | ||||||||||||
|
|
||||||||||||
| @ManyToOne(fetch = FetchType.LAZY) | ||||||||||||
| @JoinColumn(name = "author_id") | ||||||||||||
| @JoinColumn(name = "author_id", nullable = false) | ||||||||||||
| private UserEntity author; | ||||||||||||
|
|
||||||||||||
| @ManyToOne(fetch = FetchType.LAZY) | ||||||||||||
| @JoinColumn(name = "post_id") | ||||||||||||
| @JoinColumn(name = "post_id", nullable = false) | ||||||||||||
| private PostEntity post; | ||||||||||||
|
|
||||||||||||
| @Column(name = "created_at", nullable = false) | ||||||||||||
| private LocalDateTime createdAt = LocalDateTime.now(); | ||||||||||||
|
|
||||||||||||
|
||||||||||||
| @Column(name = "created_at", nullable = false) | |
| private LocalDateTime createdAt = LocalDateTime.now(); | |
| @org.hibernate.annotations.CreationTimestamp | |
| @Column(name = "created_at", nullable = false, updatable = false) | |
| private LocalDateTime createdAt; |
🤖 Prompt for AI Agents
In
src/main/java/com/spoony/spoony_server/adapter/out/persistence/feed/db/FeedEntity.java
around lines 35-37, remove the field initializer LocalDateTime.now() from
createdAt and let the database/ORM set the value: annotate the field with
Hibernate's @CreationTimestamp and set @Column(updatable = false, nullable =
false) so the timestamp is populated on insert and not updated; ensure the
proper import for org.hibernate.annotations.CreationTimestamp is added and
remove any direct initialization to avoid test/timezone inconsistencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status도 nullable=true가 들어갔음 싶네요