Skip to content

Commit

Permalink
refactor: [kakao-tech-campus-2nd-step3#30] productImage 연관관계 매핑 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyter471 committed Oct 11, 2024
1 parent 7012a46 commit d1983d0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/java/com/helpmeCookies/product/entity/ProductImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.Builder;

@Entity
public class ProductImage {
Expand All @@ -15,7 +14,13 @@ public class ProductImage {

private String photoUrl;

@ManyToOne
@JoinColumn(name = "product_id")
private Product product;
private Long productId;

public ProductImage() {}

@Builder
public ProductImage(String photoUrl, Long productId) {
this.photoUrl = photoUrl;
this.productId = productId;
}
}

0 comments on commit d1983d0

Please sign in to comment.