How to create a JPA query with LEFT OUTER JOIN

前端 未结 3 1234
攒了一身酷
攒了一身酷 2020-12-03 10:16

I am starting to learn JPA, and have implemented an example with JPA query, based on the following native SQL that I tested in SQL Server:

SELECT f.StudentID         


        
3条回答
  •  醉梦人生
    2020-12-03 10:54

    Write this;

     SELECT f from Student f LEFT JOIN f.classTbls s WHERE s.ClassName = 'abc'
    

    Because your Student entity has One To Many relationship with ClassTbl entity.

提交回复
热议问题