一、普通方式(五种)

Spring Data JPA之投影查询

参考链接:https://www.bytestree.com/spring/spring-data-jpa-projections-5-ways-return-custom-object/

二、Class-based Projections (DTOs)

除上述5种之外,还有一种Class-based Projections (DTOs),它无需像Argument Constructor方法那样使用JPQL,但是劣势是DTOs的属性为final类型。

参考链接:

https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#projections.dtos

https://www.baeldung.com/spring-data-jpa-projections 章节4

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-01-16
  • 2022-03-04
  • 2021-05-19
猜你喜欢
  • 2022-01-21
  • 2021-05-10
  • 2021-08-17
  • 2021-07-15
  • 2021-10-19
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案