Quantcast
Channel: JPA EntityManager: Why use persist() over merge()? - Stack Overflow
Viewing all articles
Browse latest Browse all 17

Answer by Sarah Vessels for JPA EntityManager: Why use persist() over merge()?

$
0
0

I noticed that when I used em.merge, I got a SELECT statement for every INSERT, even when there was no field that JPA was generating for me--the primary key field was a UUID that I set myself. I switched to em.persist(myEntityObject) and got just INSERT statements then.


Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>