For example lets consider spring data CrudRepository#save(). It is based on JPA em.persist() and em.merge(). Using save() for new entity we use pers