Skip to content

Commit 9655437

Browse files
authored
Merge pull request #55 from Decodeat/fix/54-user-behavior-mapping
fix : set cascade
2 parents 8ed7f37 + 41bfa26 commit 9655437

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/main/java/com/DecodEat/domain/products/entity

src/main/java/com/DecodEat/domain/products/entity/Product.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.DecodEat.domain.products.entity;
22

33
import com.DecodEat.domain.users.entity.User;
4+
import com.DecodEat.domain.users.entity.UserBehavior;
45
import com.DecodEat.global.common.BaseEntity;
56
import jakarta.persistence.*;
67
import lombok.*;
@@ -50,6 +51,9 @@ public class Product extends BaseEntity {
5051
@OneToMany(mappedBy = "product", cascade = CascadeType.ALL, orphanRemoval = true)
5152
private List<ProductInfoImage> infoImages = new ArrayList<>();
5253

54+
@OneToMany(mappedBy = "product", cascade = CascadeType.REMOVE, orphanRemoval = true)
55+
private List<UserBehavior> userBehaviors = new ArrayList<>();
56+
5357
/**
5458
* 상품의 대표 이미지를 새로운 URL로 업데이트
5559
*/

0 commit comments

Comments
 (0)