JPQL is an object-oriented query language used with Java Persistence API entities. Spring Data JPA can define queries through repository methods or JPQL while generating SQL behind the scenes. section 6.3.2
Because the executed SQL is not visible in repository code, investigating performance requires observing the JDBC boundary. A profiler can intercept generated queries before they reach the DBMS, allowing them to be copied into a SQL client for further analysis. section 6.3.2
public interface ProductRepository
extends JpaRepository<Product, Integer> {
}
A minimal Spring Data JPA repository shows why framework-generated SQL may not be directly visible in application code. section 6.3.2
Profiling a product lookup
A product endpoint returns purchased-product names through a repository called ten times. Profiling reveals two SQL queries, with the second executed only once because Hibernate optimizes execution. The captured query can then be investigated in a SQL development client. section 6.3.2

