Spring Data JPA using Hibernate and Java Configuration with Annotations

In this tutorial I’ll show you how to use Spring Data JPA to integrate a relational database (PostgreSQL in my example) into a Spring Boot application.

I’ll use these technologies and tools:

  • Spring Tool Suite (STS) 3.8.4.RELEASE
  • Java 8
  • Spring Boot 1.5.3.RELEASE
  • Maven 3.3.9
  • PostgreSQL 9.6.2

1. The Project Structure

The final folder structure of our project.

The folder structure of the Spring Data JPA project as seen in STS

2. Create a new Spring Boot project

If you’re using STS, you can easily create a starter project by either selecting File > New > Spring Starter Project from the main menu or right-click on the Package Explorer and select New > Spring Starter Project. Continua a leggere Spring Data JPA using Hibernate and Java Configuration with Annotations