Are you looking for some great materials for learning Hibernate framework? You can find the following a comprehensive list of Hibernate tutorials, code examples and sample projects from basics to advanced. It's a great resource to learn Hibernate framework for beginners with well-explained and practical guides.

Hibernate is an Object Relational Mapping (ORM) framework that greatly simplifies database programming in Java. Instead of writing plain JDBC code with SQL statements, you can use Hibernate annotations to map a Plain Old Java Object (POJO) class to a table in database, and use Hibernate API to manage states of POJOs. Hibernate will synchronize states of Java objects with rows in the database.

 

1. Getting started with Hibernate for beginners:

If you're new to Hibernate, I recommend you start with the following tutorials written for absolute beginners. You'll learn how to code your first Java-Hibernate project with Eclipse IDE. Then you'll learn more about using JPA annotations in Java entity classes. The guide about forward engineering is also helpful - you'll learn how to create database tables from Java entity classes. And I also share various examples of writing Hibernate Query Language (HQL) in the last guide in this beginner series.

 

2. Hibernate Entity Relationship Mapping:

When using Hibernate, it's important to understand how to create mapping between Java entity classes and tables in relational database because the framework lets developers work with Java objects instead of manipulating rows in the database. The following examples will help you represent common entity relationships in Java entity classes, such as one-to-one, one-to-many, and many-to-many associations.

Mapping One-to-One Entity Relationship:

In the following examples, you will learn how to represent different variants of the one-to-one entity relationship in Java entity classes (one-to-one with primary key and foreign key) using both XML mapping and JPA annotations.

 

Mapping One-to-Many Entity Relationship:

Check the following guides about implement one-to-many associations in entity classes using both XML configuration and Java annotations. Besides the basic one-to-many entity relationship, you will also learn about the more advanced one (using join table). And the parent-child mapping is a special case.



 

Mapping Many-to-Many Entity Relationship:

Learn how to model many-to-many association in Java entity classes with the following explanatory guides. There are also examples about mapping many-to-many entity relationship with extra columns in the join table. 

 

Other Hibernate Mapping Tutorials:

Hibernate makes it easy to map special data types in entity classes, such as enum, binary (byte array) and composite primary key. Learn how in the following articles:

 

Java Servlet, JSP and Hibernate: Build eCommerce Website

Code Functional Bookshop Website with Java Servlet and Hibernate framework. Full-stack Development. Job-ready Skills.

 

3. Hibernate Configuration:

In the following articles, I will show some examples about creating SessionFactory, using Java code-based configuration, and configuring log4j2 logging framework with Hibernate.

 

4. Advanced Hibernate Tutorials:

Check the following tutorials to learn about generating Java entity classes from tables in database (reverse engineering) and how Hibernate supports executing update queries in batch.

 

5. Hibernate and Database Connection Pooling:

 Learn how to use the database connection pooling libaries C3P0 and Proxool with Hibernate framework:

 

6. Hibernate Integration with other frameworks:

Check the following tutorials to learn how to use Hibernate with other frameworks like Spring and Struts in Java web applications:

 

7. Miscellaneous Hibernate Tutorials:

Check a nice example that illustrates how to change database schema at runtime, how to work with Oracle database and different ways to delete entites in Hibernate.

 

8. Hibernate Tutorial Videos on YouTube:

If you prefer learning the Hibernate framework by watching videos, check this playlist: Hibernate Video Tutorials on CodeJava's YouTube channel.

 

Hibernate References:


About the Author:

is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.