DEV ℧ Developer Diary

[JPA] 즉시 로딩과 지연 로딩

해당 포스트는 인프런 김영한님의 자바 ORM 표준 JPA 프로그래밍 - 기본편 을 듣고 정리한 글입니다.

즉시 로딩과 지연 로딩

바로 전 포스팅에서 배운 Proxy 객체를 이용해, Member 객체와 Team 객체와 같이 연관관계가 걸려있는 Entity의 조회에 대해 알아봤다.

여기서 Porxy객체를 조회해 오는 방법은 크게...

[JPA] 프록시

해당 포스트는 인프런 김영한님의 자바 ORM 표준 JPA 프로그래밍 - 기본편 을 듣고 정리한 글입니다.

프록시

프록시에 대해 알아보기 전에 다음과 같은 상황에 대해 가정해보자.

앞서 만들었던 Member 예시에는 Team에 대한 연관관계가 설정되어 있었다.

프록시기초1

여기서 만약 Member Entity를 조회한다고...

[JPA] @MappedSuperclass

해당 포스트는 인프런 김영한님의 자바 ORM 표준 JPA 프로그래밍 - 기본편 을 듣고 정리한 글입니다.

@MappedSuperclass

해당 어노테이션은 공통 매핑 정보가 필요할 때 사용한다 (id, name)

@MappedSuperClass

@MappedSuperclass 란?

  • 상속관계 매핑X
  • 엔티티X, 테이블과 매핑X
  • 부모 클래스를 상속 받는...

[JPA] 고급 매핑

해당 포스트는 인프런 김영한님의 자바 ORM 표준 JPA 프로그래밍 - 기본편 을 듣고 정리한 글입니다.

고급매핑

상속관계 매핑

  • 관계형 데이터베이스는 상속 관계라는 것이 없다.
  • 슈퍼타입 서브타입 관계라는 모델링 기법이 객체 상속과 유사
  • 상속관계 매핑 : 객체의 상속과 구조와 DB의 슈퍼타입 서브타입...

[JPA] A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance

이슈 사항

발생 예외

Caused by: org.springframework.orm.jpa.JpaSystemException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: kr.co.api.product.domain.classification.ProductClassification.metaHistories; nested exception is org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer...