Reputation: 136
How can I ignore cascade saving/updating when calling persist(..)
/ merge(..)
without removing cascade annotation?
Upvotes: 1
Views: 1781
Reputation: 1683
If you find you have two different use cases, one that makes using the save/update annotation useful, and one that makes it not useful, I'd create a second class, either using inheritance or simply a different class, depending on the complexity of your model. One mapping will omit the cascade annotation, to be used in those cases you don't want it to happen.
Upvotes: 1
Reputation: 597274
You can't. Two workarounds come to my mind:
Neither is a good option though.
Upvotes: 1