~1 min read

It may be the case that I’m not looking hard enough but I can’t find this anywhere in the documentation:

To achieve a cascade type of ‘none’ using Hibernate annotations you’ll need to do explicitly define the cascade attribute as an Empty list e.g.

@OneToMany(cascade = {})

Exactly why they couldn’t have provided an CascadeType.NONE enum I don’t know.

EdD

Edd Grant

Enjoyed this? I write this blog for the fun of it — but if a post saved you some time or head-scratching, you can buy me a coffee. It’s about the price of, well, a coffee, takes 20 seconds, and needs no account. It genuinely makes my day.

A handful of lovely readers have already bought me a coffee — thank you, each one's a real treat. ☕