@Query associates a repository method with an explicitly specified database query. Use it when a method name cannot express the required query clearly or completely. section 3.3.4
Querying Seattle orders
@Query("Order o where o.deliveryCity='Seattle'") List<TacoOrder> readOrdersDeliveredInSeattle(); The method name can be chosen freely because the annotation defines the query. With JPA, @Query can express queries that are difficult or impossible to derive from a method name. section 3.3.4
Choose the query form according to the Spring Data technology:
- JPA supports explicitly written JPA queries through @Query. section 3.3.4
- Spring Data JDBC requires @Query for every custom query, and those queries must use SQL rather than JPA query syntax. section 3.3.4

