In a spring boot app, we have user-defined repository interface that extends JpaRepository. JpaRepository in turn is has an implementation class SimpleJpaRepository. SimpleJPARepository has 2 annotations on it
- @Transactional
- @Repository
So we can skip these 2 annotations on our user-defined repository interface that extends JpaRepository. Then why do we need to explicitly add @Transactional over service class which is also using our user-defined repository object only?