SyntaxFix
Write A Post
Hire A Developer
Questions
It should be CascadeType.Merge, in that case it will update if the record already exists.