Entity Manager / persistance file structure
问题 The title isn't clear as I couldn't think of one but, I have an EJB project and am trying to play with JPA. To create the entity manager I am injecting it in via annotations @PersistenceContext(unitName="testConnection") private EntityManager em; When I run a test query which I believe to be fine Query userQuery = em.createQuery("SELECT u FROM TestUser u WHERE u.username = 'test' u.password = 'test'"); tu = (TestUser) userQuery.getSingleResult(); I get an exception which points toward the EJB