Read Data from JPA the ways to do it
问题 I read in the documentation and i see that to read the jpa data i need to use the following code. this is the only way to read the data from the JPA tables via sql? factory = Persistence.createEntityManagerFactory("abc"); EntityManager entityManager = factory.createEntityManager(); Query query = entityManager.createQuery("SELECT p FROM " + className + " p"); 回答1: There are several ways to read data using JPA. The example you provided is using JPQL. Additionally, you can: execute a native SQL