准備:
Spring Boot + Web + Jpa
代碼:
類:AccountRepository
@Query(value = "select new com.sino.report.entity.Test(a.id,a.userName) from Account a LEFT Join Hospital h on a.id = h.id")
List<Test> findTest2();
運行項目直接出錯
Path expected for join!
參考了它才知道問題所在:https://www.cnblogs.com/icebutterfly/p/9515897.html
必須要在進行關聯的表中做關系映射。
