How do spring data generate sql according to the method name?

I know that spring jpa data can execute sql in two ways. One of them is sql execution, which is included in @Query, the other is the name of the analysis method and sql generation. I am cloning the source code for spring jpa data from github and want to find how spring data generates sql according to the method name. But I can not find the class associated with the name of the analysis method. So could you tell me something about how spring jpa data works with the name of the parsing method? thank

+4
source share
1 answer

Its multi-stage process:

  • Spring JPA data generates a proxy class for the repository interface.
  • PartTree PartTreeJpaQuery. PartTree Spring Data Commons, Spring (, Data JPA).
  • PartTree JpaQueryCreator JPA CriteriaQuery.
  • CriteriaQuery JPA (Hibernate, OpenJPA, EclipseLink ..), SQL .
+4

Source: https://habr.com/ru/post/1648727/


All Articles