Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Inheritance(JOINED) 상태에서 슈퍼클래스만 조회하기 #1

Open
Sun26-Avrin opened this issue Jan 28, 2022 · 0 comments
Open

Comments

@Sun26-Avrin
Copy link
Owner

Sun26-Avrin commented Jan 28, 2022

a40c353 (@Inheritance(JOINED) 상태에서 슈퍼클래스만 조회하기)

  1. 서브클래스에 @polymorphism(type = PolymorphismType.EXPLICIT) 사용

가능할 것 처럼 적어놓은 문서 (바로가기)

불가능한 이유 (바로가기) - 슈퍼클래스가 엔티티가 아닐 때 가능

  1. EclipseLink 라이브러리 사용으로 쿼리 커스터마이징

가능할 것 처럼 적어놓은 문서 (바로가기)

실제 적용결과.... (동작안함)

  1. @immutable을 이용한 ReadOnly 엔티티 생성 (스터디 팀원분의 제보)

가능 (바로가기)

하지만 필드가 많아질 경우, 반복코드 생성

  1. QueryDSL 로 조회

QueryDSL 은 JPQL을 사용하기 때문에, 영속성관리를 피할 수 없음.

  1. 네이티브 쿼리로 조회 (최후의 선택)

힝구,,,

  1. DTO-Projection + Spring Data Query Method 로 상위객체만 조회가능!!!!!!!!! (01000f4)

와!!!!!!!!!!! 진작 실험해볼걸 ㅠㅠㅠ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant