
The last option has the disadvantage that it either involves XML or burdening the domain class with the queries. The advantages of this API will become more pronounced when dealing with a large number of fixed queries, as we could potentially express these more concisely through a smaller number of reusable blocks. This makes the whole operation much more readable and reusable. The third option, Specifications and Querydsl support, is similar to JPA Criteria, but uses a more flexible and convenient API. define custom queries via JPA Named Queries.use the more advanced Specification and Querydsl support in Spring Data.provide the actual JPQL query by using the annotation.simply define a new method in the interface.

To define more specific access methods, Spring JPA supports quite a few options: As discussed, by implementing one of the Repository interfaces, the DAO will already have some basic CRUD methods (and queries) defined and implemented.
