JPA EntityManager:爲什麼使用persist() 而不是merge()? - JPA EntityManager: Why use persist() over merge()?

問題:

EntityManager.merge() can insert new objects and update existing ones. EntityManager.merge()可以插入新對象並更新現有對象。

Why would one want to use persist() (which can only create new objects)?爲什麼要使用persist() (它只能創建新對象)?


解決方案:

參考一: https://stackoom.com/question/4ULw
參考二: JPA EntityManager: Why use persist() over merge()?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章