I\'m using Spring Data JPA repositories (like MyRepo extends JpaRepository
) and it works without @Repository
and without @EnableJpaRepositori
you don't need @Repository to make use of Spring Data JPA. The Interface extending the CrudRepository or JPARepository would work even without annotating it with @Repository. The Core reason why you need to have this annotation in place is it makes unchecked exceptions thrown in the DAO layer eligible to be translated into Spring DataAccessException. Which in turn would be easier to work with. This is the important aspect of using @Repository
More details see this -> https://www.youtube.com/watch?v=z2re1MfWtz0&list=PLO0KWyajXMh4fGMvAw1yQ1x7mWayRcmX3&index=8&t=0s