PrepAway - Latest Free Exam Questions & Answers

Which expression creates the Entity Manager when the project name is the same as the persistence-unit name &qu

To test defined JPA entities, the Entity Manager must be created. Which expression creates the
Entity Manager when the project name is the same as the persistence-unit name “RAD8JPA”?

PrepAway - Latest Free Exam Questions & Answers

A.
EntityManager em = Persistence.createEntityManagerFactory.createEntityManager();

B.
EntityManager em =
Persistence(“RAD8JPA”).createEntityManagerFactory().createEntityManager();

C.
EntityManager em = Persistence.createEntityManagerFactory(“RAD8JPA”).createEntityManager();

D.
EntityManager em = Persistence.createEntityManagerFactory().createEntityManager(“RAD8JPA”);


Leave a Reply