I have a JPA-persisted object model that contains a many-to-one relationship: an Account has many Transactions. A Transaction has one
Account
Transactions
Transaction
The solution is simple, just use the CascadeType.MERGE instead of CascadeType.PERSIST or CascadeType.ALL.
CascadeType.MERGE
CascadeType.PERSIST
CascadeType.ALL
I have had the same problem and CascadeType.MERGE has worked for me.
I hope you are sorted.