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.
This topic is available to PRO members.
Open this topic Go PRO Sign in Create a free accountRun 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