Skip to content

Commit

Permalink
[feat]Product와 Image 연관관계 매핑
Browse files Browse the repository at this point in the history
  • Loading branch information
emilywin825 committed Sep 16, 2023
1 parent a57e612 commit 2c011ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class CartListDataResponseDTO {
private int quantity; //수량
private String productName;
private String price;
private String url;

public CartListDataResponseDTO(Cart cart) {
this.cartId=cart.getCartId();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.hicardi.domain.product.entity;

import com.example.hicardi.domain.image.entity.Image;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -10,6 +11,8 @@
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Builder
@AllArgsConstructor
Expand Down Expand Up @@ -43,5 +46,7 @@ public class Product {
private String option;



@OneToMany(mappedBy = "product", cascade = CascadeType.ALL, orphanRemoval = true)
@Builder.Default
private List<Image> images = new ArrayList<>();
}

0 comments on commit 2c011ad

Please sign in to comment.