Spring Persistence Tutorial

I usually post about Persistence on Google+ - you can follow me there:


This tutorial series focuses on doing Persistence with Spring – illustrating examples with Hibernate, JPA and Spring Data.

1. Core Persistence

Hibernate 3 with Spring

Setup Hibernate 3 with Spring – the Java and XML Configuration, integration with MySQL and usage best practices.

Hibernate 4 with Spring

Setup Hibernate 4 with Spring – the Java and XML Configuration, how to use and best practices.

JPA with Spring

Setup JPA with Spring – the Java and XML Configuration, the Maven dependencies and a generic DAO example.

Persistence with Spring Data JPA

Spring Data JPA with Spring – how to remove the DAO implementation, manual and automatic custom queries, transactions with Spring Data and configuration.


2. The DAO

The DAO with Spring and Hibernate

Implement a generic DAO with Hibernate in Spring.

The DAO with JPA and Spring

How to implement the DAO with JPA in a Spring project.

Simplify the DAO with Spring and Java Generics

How to simplify the Data Access Layer by using a single, generified DAO, which will result in elegant data access, with no unnecessary clutter.


3. Advanced Persistence

Transaction Configuration with Spring and JPA

Transaction Configuration with Spring 4 and JPA – how to Enable and Configure Transactions and set up Transaction Propagation.

Hibernate Mapping Exception – Unknown Entity

Hibernate Mapping ExceptionUnknown Entity – causes and solutions.

Sorting with JPA

How to Sort in JPA using JQL or the Criteria API.

Sorting with Hibernate

Sort with Hibernate 4 using HQL or the Criteria API.

JPA Pagination

Pagination in JPA – how to use JQL and the Criteria API to do pagination correctly.

Hibernate Pagination

Pagination in Hibernate – using basic HQL, ScrollableResults as well as the more flexible and type-safe Criteria API.


4. Other Spring Tutorials


The entire tutorial in based on this github project. Watch and fork it at will – the project can be used as a starting point for a more full fledged implementation.

I usually post about Persistence on Google+ - you can follow me there:

Get the eBooks and Learn to Build a Simple App
Build a Simple but Working App with Spring

, ,

  • _madFrog

    Thank you so much for putting it all up at once place.