Skip to content

Commit

Permalink
feat: medicine delete 를 위한 cascade 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
iampingu99 committed Aug 3, 2024
1 parent 968c839 commit 016f860
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.holing.bounded_context.medicine.entity;

import com.example.holing.bounded_context.user.entity.User;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand Down Expand Up @@ -37,7 +38,7 @@ public class Medicine {
@JoinColumn(name = "user_id", nullable = false)
private User user;

@OneToMany(fetch = FetchType.LAZY, mappedBy = "medicine")
@OneToMany(fetch = FetchType.LAZY, mappedBy = "medicine", cascade = CascadeType.REMOVE)
private List<MedicineHistory> medicineHistoryList = new ArrayList<>();

@Builder
Expand Down

0 comments on commit 016f860

Please sign in to comment.