79321653

Date: 2025-01-01 13:18:01
Score: 1
Natty:
Report link

Before you trying to delete the Child, you must to delete all entities related to him (SubChild), because of the SubChild holds the Child by REFERENCES (SQL) in Your SubChild class:

@ManyToOne
@JoinColumn(name = "CHILD_ID")
@EqualsAndHashCode.Exclude
private Child child;

So, when you going to remove the Child, remove firstly the all SubChild related to him and after it, remove the Child entity better to do this under @Transactional

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Transactional
  • Low reputation (0.5):
Posted by: Reuven Eliezer