Skip to content
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

Model.deleteCascadeExcept() does not propagate excluded associations #880

Closed
yanchevsky opened this issue Aug 20, 2019 · 0 comments
Closed
Assignees

Comments

@yanchevsky
Copy link
Contributor

For example:

DOCTORS
(
                ID,
                FIRST_NAME,
                LAST_NAME
)
 
DOCTORS_PATIENTS
(
                ID,
                DOCTOR_ID,
                PATIENT_ID
)
 
PATIENTS
(
                ID,
                FIRST_NAME,
                LAST_NAME
)
 
PRESCRIPTIONS
(
                ID,
                NAME,
                PATIENT_ID
                DOCTOR_ID
)


In case

patient.deleteCascadeExcept(
                Doctor.getMetaModel().getAssociationForTarget(Prescription.class),
                Patient.getMetaModel().getAssociationForTarget(Prescription.class)
);

prescription (associated with doctor but not with patient) will be deleted.

Expectation: prescriptions for other patients should not be deleted

@yanchevsky yanchevsky self-assigned this Aug 20, 2019
yanchevsky pushed a commit that referenced this issue Aug 20, 2019
@yanchevsky yanchevsky mentioned this issue Aug 20, 2019
@ipolevoy ipolevoy changed the title Model.deleteCascadeExcept() has ignore third-party association exclusion Model.deleteCascadeExcept() does not propagate excluded associations Aug 27, 2019
ipolevoy pushed a commit that referenced this issue Aug 27, 2019
Model.deleteCascadeExcept() does not propagate excluded associations #880
ipolevoy pushed a commit that referenced this issue Aug 27, 2019
ipolevoy pushed a commit that referenced this issue Aug 27, 2019
ipolevoy pushed a commit that referenced this issue Aug 27, 2019
ipolevoy pushed a commit that referenced this issue Aug 27, 2019
…lusion - fix sql

(cherry picked from commit c74f0ab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants