A unidirectional @OneToMany owns the foreign key from the wrong side. Hibernate cannot express 'remove one child', so it nulls out every FK and writes them all back - N deletes and N inserts to remove one row.
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-25