Skip to content
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

reviewPic 쪽 reviewId 복합키로 수정 #346

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/java/com/green/acamatch/entity/review/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
public class Review extends UpdatedAt {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "review_id")
private Long reviewId;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ReviewPic extends CreatedAt {

@ManyToOne
@JoinColumn(name = "review_id", nullable = false)
@MapsId("reviewId")
@OnDelete(action = OnDeleteAction.CASCADE) // Review 삭제 시, 사진도 삭제됨
private Review review;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
@Embeddable
@EqualsAndHashCode
public class ReviewPicIds implements Serializable {
@Column(name = "review_id")
private Long reviewId;

@Column(name = "review_pic", nullable = false, length = 255)
@Column(name = "review_pic", nullable = false)
private String reviewPic; // 사진 URL 저장

}