Persistence Context
JPA를 이해하는데 가장 중요한 용어
Entity를 영구 저장하는 환경
논리적인 개념
EntityManager를 통해 Persistence Context에 접근
Entity Life Cycle
비영속
(
new
/transient) : Persistence Context와 전혀 관계가 없는 상태
영속
(
managed
) : Persistence Context에 관리되는 상태
준영속
(
detached
) : Persistence Context에 저장되었다가 분리된 상태
삭제
(
removed
) : 삭제된 상태
Example
em.detach(entity)
: 특정 Entity만 준영속 상태로 전환