Question: what is the difference between merge and persist in hibernate?
Answer: JPA's merge method copies the state of a detached entity to a managed instance of the same entity. ... If the persistence context already contained a managed instance of the entity, Hibernate uses the existing one instead. It then copies all attribute values to the managed entity and returns it to the caller.