Hibernate Transaction Management Using Spring

In Hibernate, communication with the database always occurs through a database transaction. A Hibernate application can run in : non-managed environment : the developer needs to manage the database transactions himself by manually setting the begin, commit or rollback. managed…

Hibernate CRUD example using HQL

Hibernate Query Language (HQL) is an object query language provided by Hibernate to manipulate data held in databases. It is inspired by SQL but instead of working directly with tables It uses persistent objects. In this example, we will perform some useful…

Hibernate Criteria Example

  In this example, we will see how to use Hibernate Criteria API to build some criteria queries to retrieve data from database.   1. Technologies used Hibernate 4.3.6.Final MySQL 5.1 Maven 3.0.5 Eclipse 4.5 JDK 1.7   2. Database table   3. Project structure  …

Hibernate One to Many Annotation Example

  In this tutorial, we will see how to perform one to many mapping in Hibernate using annotations. We will use the Hibernate One to Many XML Mapping Example  and enhance it to support annotations   1. Technologies used Hibernate 4.3.6.Final MySQL…

JSF 2 Spring Hibernate Example

  In this example, we will see how to integrate JSF 2, Spring IoC, Spring Security and Hibernate in a simple web application. The application will provide : registration page to add new users, login page to perform authentication and…

Hibernate One to One Annotation Example

  In this example, we will see how to perform one to one mapping in Hibernate using annotations. We will use the Hibernate One to One XML Mapping Example  and enhance it to support Hibernate annotations.   1. Technologies used Hibernate 4.3.6.Final MySQL 5.1 Maven…

Struts 1 Hibernate integration example

In this tutorial, we will see how to integrate Hibernate in a Struts 1 web application to perform some database operations. So, We will : Create a MySQL table : User Create Eclipse web project and add the required libraries and…