i have a doubt on concept i think i am mixing some stuff. I have a application with DAO layer the implementation of those DAO use SessionFactory (Hibernate) to execute the CRUD operation, i also have a service layer and manage my unit of work with Spring Declarative Transaction, and everything work fine, i am not sure about wether to use EntityManager or not but it seems that what it does is manage my unit of work (same thing that i am doing with Spring).
When should i use EntityManager? What is the advantages of using it? Why Should i use it?
Thank you.