Transient2 [JPA] Entity의 LifeCycle 백기선님의 Spring Data JPA 강좌를 참고하여 정리한 내용입니다. Entity의 상태 Entity의 상태에는 크게 4가지가 있다. Transient Persistent Detached Removed 각각의 상태 변화에 대해 알아보자 Transient : JPA가 모르는 상태 (단순 객체 생성) Account account = new Account(); account.setUsername("seokhun"); account.setTitle("JPA"); Persistent : JPA가 관리중인 상태 (1차 캐시, Dirty Checking, Write Behind) Session session = entityManager.unwrap(Session.class); session.save(accoun.. 2020. 3. 3. [Java] 자바 transient transient 란? transient는 Serialize 하는 과정에서 제외하고 싶은 경우 선언하는 키워드이다. 사용하는 이유 패스워드와 같은 보안정보를 직렬화(Serialize) 과정에서 제외하고 싶은 경우에 적용 다양한 이유로든 데이터를 전송하고 싶지 않을 때 선언 예제 class Member implements Serializable { private String name; private String email; private int age; public Member(String name, String email, int age) { this.name = name; this.email = email; this.age = age; } @Override public String toString() .. 2019. 7. 16. 이전 1 다음