准备:

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 

 

必须要在进行关联的表中做关系映射。

 

相关文章:

  • 2022-12-23
  • 2021-09-18
  • 2021-11-13
  • 2022-01-17
  • 2021-11-27
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2022-12-23
  • 2021-10-20
  • 2022-01-14
  • 2021-06-16
  • 2021-08-03
  • 2021-09-02
相关资源
相似解决方案