Click here to Skip to main content
15,889,727 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm new to JPA and generally understand what ORM technologies do. I'm having a serious problem, I want to understand the use of JPA from beginning to end in a comfortable way, instead of memorizing it. So, can you explain what was done here in order? Can anyone tell them what to do? For example, why are we creating the persistence xml file, can you tell me what should I do first and what should I do at the end? Also, could you explain what each line of code means below?


EntityManagerFactory emf = Persistence.createEntityManagerFactory("persistenceName");

EntityManager em = emf.createEntityManager();

EntityTransaction et = em.getTransaction();

et.begin();

em.methodOfEntityManager();
et.commit(); 


What I have tried:

I'm having a hard time understanding the user manual for it.
Posted
Updated 27-Jul-21 5:34am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900