Cant inject EntityManager With @PersistenceContext in most basic example
问题 To test JPA with PersistenceContext injection of entity manager I have basic example project with following structure: Person entity: @Entity public class Person { @Id @GeneratedValue private long id; private String name; private String surname; public Person() { } public Person(String name, String surname) { this.name = name; this.surname = surname; } public long getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public