What is the point of putting @Repository in service class CustomerServiceImpl and is it a good practice in this example, my understanding it is not needed for any interfaces that extend JpaRepository and exception translation already included. As far as I understand @Repository "should" be on repository class?
@Repository
@Transactional(readOnly = true)
public class CustomerServiceImpl implements CustomerService {
@PersistenceContext
private EntityManager em;
@Autowired
private CustomerRepository repository;
...
}
@Transactional(readOnly = true)
public interface CustomerRepository extends JpaRepository<Customer, Long> {}