I am developing a Spring-Boot application using spring-boot-starter-data-jpa. I am not able to understand which annotation I should use for injecting EntityManager?
@Autowired
or @PersistenceContext
I know @PersistenceContext
is a JPA annotation whereas @Autowired
belongs to Spring. But internally how do they make a difference?
I have already taken a look at this. But could not understand the exact reason.