JPA EntityManager:为何在merge()上使用persist()? - JPA EntityManager: Why use persist() over merge()?

问题:

EntityManager.merge() can insert new objects and update existing ones. EntityManager.merge()能够插入新对象并更新现有对象。 spa

Why would one want to use persist() (which can only create new objects)? 为何要使用persist() (只能建立新对象)? .net


解决方案:

参考一: https://stackoom.com/question/4ULw/JPA-EntityManager-为何在merge-上使用persist
参考二: https://oldbug.net/q/4ULw/JPA-EntityManager-Why-use-persist-over-merge
相关文章
相关标签/搜索