JPQL 문 사용


sql문에서
※ fetch를 사용하지 않을 경우
select b from Board b join b.user where b.id=:id
userId 만 가져오게 됩니다. (user객체 정보는 null값으로 처리됨)
※ fetch를 사용할 경우
select b from Board b join fetch b.user where b.id=:id
DB를 두번 조회하지 않음 (자원절약)
한번에 조회한 board객체와 관련된 user객체의 정보까지 가져올 수 있습니다.
Share article