My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
JPA EntityManager: Why use persist() over merge()?

JPA EntityManager: Why use persist() over merge()?

Jack Kim's photo
Jack Kim
·Apr 27, 2017

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only create new objects)?