Quote:
Don't you see that writing stuff like this, in this tone, is kinda insulting and frustrating to us? Especially when all you have to do to make it work is exactly follow the example I quoted from the documentation, or look at some other examples in the test packages? You probably didn't mean to be insulting, but think how it sounds to me... Yes, I am over-sensitive; that's because it's my work you're talking about.
Well, now, that makes sense to me. I certainly know how touchy I can get about
my work, so I can understand your position. It is why, even when reprimanded for not reading documentation in one of my earliest posts, I tried to remain respectful in my reply. The service that hibernate offers to us (for free!) is incredible, and I do
not wish to be anything less than grateful. But I do try very hard to understand how it works and all of the documentation. Being accused of not reading docs when I have (but either don't remember where I read it, when I read it, or even
that I read it) can be just as frustrating: that's
my work
you're talking about. I will strive harder to remember your position in my posts.
Now, as for this case, to summarize:
- no singe-valued relationship (either <many-to-one> or <one-to-one>) may specify delete-orphan in its cascade type.
- the correct solution to "allow" this behavior is to change the association (user.setToken(null)) and directly delete the referenced entity using session.delete()
Are these correct?