문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:jpa:nativequery [2018/09/17 17:27] kwon37xi |
java:jpa:nativequery [2019/01/11 16:01] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== JPA and Native Query (SQL) ====== | ====== JPA and Native Query (SQL) ====== | ||
* [[https:// | * [[https:// | ||
+ | * [[java: | ||
- | ===== ResultSetMapping ===== | + | ===== NativeSQL 결과 암묵적 Entity 매핑 ===== |
+ | * Native Query 결과를 entity 로 받는 방법으로 암묵적으로 할수도 있다. | ||
+ | * '' | ||
+ | |||
+ | <code java> | ||
+ | Book b = (Book) em.createNativeQuery(" | ||
+ | </ | ||
+ | |||
+ | ===== NativeSQL 결과 명시적 Entity 매핑 : ResultSetMapping ===== | ||
* 단일 엔티티에 대한 Native Query 실행은 매핑이 필요없다. | * 단일 엔티티에 대한 Native Query 실행은 매핑이 필요없다. | ||
* 다중 Entity를 결과로 받는 Native Query는 [[http:// | * 다중 Entity를 결과로 받는 Native Query는 [[http:// | ||
줄 45: | 줄 54: | ||
===== 참고 ===== | ===== 참고 ===== | ||
- | [[https:// | + | * [[https:// |
+ | * [[https:// |