I have a problem with persisting data via play-framework. Maybe it\'s not possible to achive that result, but it would be really nice if it would work.
Simple>
When you update a complex instance in Hibernate you need to make sure it is coming from the database (fetch it first, then update that same instance) to avoid this 'detached instance' problem.
I generally prefer to always fetch first and then only update specific fields I'm expecting from the UI.
You can make your code a bit more generic using
(T)Model.Manager.factoryFor(relation.getClass()).findById(relation.id);