-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use deleteInBatch due to cascade issue #3198
Comments
No, It's not a bug, it's used for bulk delete with one single query. Here is the Javadoc of
I think the javadoc need be improved to clarify that cascade and events are ignored in this case, You should consider using It's contrary to #3177 |
Thanks guys for the quick response 👍 :) |
I have entity A and B.
A is binded to B in a one-to-one relationship while the owning side is B in the relation(i.e, a_id is in B).
The issue that I faced is, when I try to delete a collection of A objects using
repo.delete
method, respective elements of B is deleted and then A is deleted, which is fine. But, when I try to delete the same collection of A objects usingrepo.deleteInBatch
method, elements of B are not pushed for delete and the ORM is directly trying to delete the records of A because of which I get into exceptions.. It appears to be an issue with the cascade.This seems to be a bug with deleteInBatch method since the same is working for regular deletes.
I am using Spring Boot 2.7.3
JDK: 1.8
DB: Postgresql
The text was updated successfully, but these errors were encountered: