PersistenceContext EntityManager null

Hi,

I’m rookie with JPA and I’m triying to do a insert in a postgres using JPA in the first ServiceTask i put:

@PersistenceContext
private EntityManager entityManager;

But this entityManager is null, in the examples i don’t see where is initializing this variable. Someone can explain me How does it work?

Best regards,