Struggling with JPA and detached entities