In a Spring Data JPA repository, which annotation is used to annotate a custom query when the derived query mechanism is not sufficient?

  • @Query
  • @CustomQuery
  • @CustomMethod
  • @CustomRepo
In Spring Data JPA, when the derived query mechanism is not sufficient, you can annotate a custom query method with the @Query annotation. This annotation allows you to define custom queries using JPQL or native SQL. There's no @CustomQuery annotation in Spring Data JPA, and the other options mentioned are not standard annotations for this purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *