Why hibernate generates insert and update for OneToMany mapping

I know this is crazy old but I had the same problem and Google brought me here, so after fixing it I figured I should post an answer.

Hibernate will switch the insert/update approach to straight inserts if you make the join column not nullable and not updatable, which I assume in your case it is neither anyways:

@JoinColumn(name = "PRODUCT_ID", nullable = false, updatable = false)

Leave a Comment