posted 1 year ago
Good Morning. I'm doing a rest API for an app, and I need that whenever from 00h the user data stored in a List<> be deleted. This list lists OneToMany data.
I have 2 entities, the parent entity (DayUser) and the child entity (FoodConsumed).
Child Entity:
I use this repository for the child entity:
The problem is the following, when I try to delete the data by the id in a task they just change the id and continue in the database. But when I try to DELETE a API request it works normally.
Scheduled Task (It's not working):
When this task is executed, the items go to a new id and remain related to the DayUser even though I call the repository.deleteByID