As of now I have a working Spring application with persistence. However now I want to use Hibernate with JPA to do all of my database activities. I want to do this using an entitymanager.
I’ve been reading many documents and tutorials on this matter, I’ve been getting confused on whether I need a persistence.xml file or not. Also I’ve been getting confused on how to setup my applicationContext.xml file as well.
Does anybody know of a good site to look at in order to learn Spring + Hibernate + JPA + using EntityManager?
I’ve just spent the last couple of weeks trying to set up the same kind of project.
You do need a persistence.xml file, and it belongs in META-INF
Here is an example of my spring beans file for persistence:
Also, I am using Maven to pull in the spring3 and hibernate dependencies i need.
edit: for a learning resource I highly recommend “Spring Recipes A Problem-Solution Approach” by Gary Mac http://www.apress.com/book/view/9781590599792. This is one of the best technical books I’ve ever read, and it will surely help you get up and running with Spring/JPA/Hibernate.