How to Configure a JPA Project Using Spring and Hibernate

Solving Interesting Problems by Technical Means


In most Java projects that involve a database, a ORM(Object Relational Mapping) layer is needed. This can be done by hand via JDBC. Spring does make the job easier however with a JdbcTemplate. The other way is to use one of the libraries that is popular is Hibernate. Another standard that is getting popular is JPA (Java Persistence API). The advantage of JPA is that it standardizes the API between ORM libraries and the DAO (Data Access Object) layer. This makes it easier to swap out different ORM libraries as requirements change. In this post I am going to show how to configure Hibernate with Spring using the JPA standard on a Java SE application.


Maven pom.xml

Here is the pom.xml file used to pull the dependencies

<project xmlns=”″


xsi:schemaLocation=”” >
















View original post 262 more words