we can declare repository classes in this way
public interface DepartmentRepository extends JpaRepository<Department, Integer>
and this way
@Repository
public interface DepartmentRepository extends JpaRepository<Department, Integer>
What is the difference between this two approach mentioned. Because if we remove the @Repository annotation then the code will work fine then what is the difference, can anyone explain me on this.