Skip to main content

JPQL and @Modifying Queries

Learn JPQL and @Modifying Queries (Spring Data JPA, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

JPQL: SQL Written Against Your Classes JPQL (Jakarta Persistence Query Language) looks like SQL, but it names entities and fields , not tables and columns. Hibernate translates it to the SQL of whichever database you use, so the same query runs on MySQL, PostgreSQL or H2. Use @Query on a repository method when the method name would be too long for a derived query, or when you need a join, aggregate or update.

More lessons in Spring Data JPA