In JPA, is there any way you can replicate Hibernate\'s saveOrUpdate behavior,
saveOrUpdate public void saveOrUpdate(Object object) throws
Try using the EntityManager.merge method - this is very similar.
EntityManager.merge
There is an excellent description of the differences in Xebia's blogpost: "JPA Implementation Patterns: Saving (Detached) Entities."