The DAO with Spring and Hibernate 1. Overview This article will show how to implement the DAO with Spring and Hibernate. For the core Hibernate configuration, check out the previous Hibernate 5 with Spring article. 2. No More Spring Templates Starting Spring 3.0 and Hibernate 3.0.1, the Spring HibernateTemplate is… Continue Reading persistence-layer-with-spring-and-hibernate

Hibernate One to Many Annotation Tutorial 1. Introduction This quick Hibernate tutorial will take us through an example of a one-to-many mapping using JPA annotations – an alternative to XML. We’ll also learn what bidirectional relationships are, how they can create inconsistencies, and how the idea of ownership can help. Further reading: Spring… Continue Reading hibernate-one-to-many

Criteria Queries Using JPA Metamodel 1. Overview In this tutorial, we’ll discuss how to use the JPA static metamodel classes while writing criteria queries in Hibernate. We’ll need a basic understanding of criteria query APIs in Hibernate, so please check out our tutorial on Criteria Queries for more information on this… Continue Reading hibernate-criteria-queries-metamodel

Mapping A Hibernate Query to a Custom Class Persistence Hibernate 1. Overview When we use Hibernate to retrieve data from the database, by default, it uses the retrieved data to construct the whole object graph for the object requested. But sometimes we might want to retrieve only part of the… Continue Reading hibernate-query-to-custom-class