Are you by any chance using "service" through a remote interface?
Why do you need to cast the result to User btw? Does that method return other objects than Users?
Thansk for your reply. It turns out that the exception is thrown because the cascade option. This works fine.
Dose not work because my User have an external reference to a Address. So bt deleting User it would like to also delete The Address.
Now I would like to know who do I set the cascade option. So I can delete a Player without removing a Team. And vice versa.
Thanks for your time.
Sorry for reposting, but Im not able to edit my post.
To answer your question, yes Im using my service through remote interface. And casting is overflow, its always returning a user.
I have look a bit more into CASCADE but Im only finding option for enable, not disable. So default should be disable? Why cant I cant I remove a simple Entity with no external reference?