首页 > 代码库 > entityManager
entityManager
Scenario | EntityManager.persist | EntityManager.merge | SessionManager.saveOrUpdate |
---|---|---|---|
Object passed was never persisted | 1. Object added to persistence context as new entity 2. New entity inserted into database at flush/commit | 1. State copied to new entity. 2. New entity added to persistence context 3. New entity inserted into database at flush/commit 4. New entity returned | 1. Object added to persistence context as new entity 2. New entity inserted into database at flush/commit |
Object was previously persisted, but not loaded in this persistence context | 1. EntityExistsException thrown (or a PersistenceException at flush/commit) | 2. Existing entity loaded. 2. State copied from object to loaded entity 3. Loaded entity updated in database at flush/commit 4. Loaded entity returned | 1. Object added to persistence context 2. Loaded entity updated in database at flush/commit |
Object was previously persisted and already loaded in this persistence context | 1. EntityExistsException thrown (or a PersistenceException at flush or commit time) | 1. State from object copied to loaded entity 2. Loaded entity updated in database at flush/commit 3. Loaded entity returned | 1. NonUniqueObjectExceptionthrown |
entityManager
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。