Spring Data JPA allows us to write queries to the database in several ways. The simplest option is to use inferred queries, where Spring creates the query from the repository’s method name, but there are occasions where
we need more complex queries and we must write them directly using JPQL or native SQL....