问题
@ApplicationScoped
public class PersonDao {
@PersistenceContext
private EntityManager entityManager;
public List<Person> getAllPersons()
{
Query query=entityManager.createQuery("SELECT p FROM PersonEntity p");
List<Person> persons=query.getResultList();
return persons;
}
}
Can you please help.. Thanks
来源:https://stackoverflow.com/questions/59541849/when-injecting-entitymanager-using-cdi-2-0-throws-java-lang-nullpointerexception