a 테이블에 있는 b키를 이용해서 a 테이블에 해당하는 b 테이블들을   a +b 합쳐진 리스트로 가져오고 싶은데 이럴떄 mysql에서 어떻게 해야 함?



정확히는 jpa + querydsl 쓰는데 어떻게 불러와서 어떻게 받음?


 select a.s_code as 사원코드,b.name as 이름,c.b_code as 부품코드,c.b_name as 부품명,a.price as 매출량,a.g_price as 목표량,a.date as 날짜 

from a,b,c 

where a.s_code = b.s_code and a.b_code=c.b_code; 



이런 걸 받아고 싶은데 이걸 어떻게 하면 jpa로 구현함?



2.3.8. 조인

다음 구문을 이용해서 조인을 한다.

QCustomer customer = QCustomer.customer; QCompany company = QCompany.company; query.from(customer) .innerJoin(customer.company, company) .list(customer.firstName, customer.lastName, company.name);

레프트 조인은 다음과 같다.

query.from(customer) .leftJoin(customer.company, company) .list(customer.firstName, customer.lastName, company.name);

조인 조건을 쓸 수도 있다.

query.from(customer) .leftJoin(company).on(customer.company.eq(company.id)) .list(customer.firstName, customer.lastName, company.name);