작성자 없음
작성자 정보가 삭제된 글입니다.
작성
·
189
0
Member member1 = new Member();
member1.setUsername("hello");
em.persist(member1);
em.flush();
em.clear();
Member reference = em.getReference(Member.class, member1.getId()); // 영속성 컨텍스트에서 가져옴
System.out.println("reference.getClass() = " + reference.getClass());
// em.detach(reference);
em.close();
System.out.println("reference.getUsername() = " + reference.getUsername());