Persist1 em.persist vs em.merge package jpabook.jpashop.repository;import jakarta.persistence.EntityManager;import jpabook.jpashop.domain.item.Item;import lombok.RequiredArgsConstructor;import org.springframework.stereotype.Repository;import java.util.List;@Repository@RequiredArgsConstructorpublic class ItemRepository { private final EntityManager em; public void save(Item item) { if (item.getId() == null) { em.persi.. JPA 2024. 11. 30. 이전 1 다음