This hibernate tutorial provides in-depth concepts of Hibernate Framework with simplified examples. It was started in 2001 by Gavin King as an alternative to EJB2 style entity bean. The stable release of Hibernate till Aug 28, 2013, is hibernate 2.2.5. It is helpful for beginners and experienced persons.
Hibernate framework simplifies the development of java application to interact with the database. Hibernate is an open source, lightweight, ORM (Object Relational Mapping) tool.
An ORM tool simplifies the data creation, data manipulation and data access. It is a programming technique that maps the object to the data stored in the database.
The ORM tool internally uses the JDBC API to interact with the database.
There are many advantages of Hibernate Framework. They are as follows:
Upcoming topics in Hibernate Tutorial
Basics of Hibernate
Here, we will learn what are the major elements of hibernate. There is given two figures to understand the hibernate architecture.
Steps to create Hibernate Application without IDE
Here, we will see the 6 steps to connect to the database in java using Hibernate. You may also download the jar files for hibernate here.
Creating Hibernate Application in Eclipse IDE
In this Hibernate tutorial, we will connect hibernate program with the oracle database using the eclipse IDE.
We will create the hibernate application here step by step.
Creating Hibernate Application in MyEclipse IDE
Here, we will connect hibernate program with the oracle database using the Myeclipse IDE.
There is given the steps to create the hibernate application.
Hibernate with annotation
Here, we will create a simple hibernate application with annotation.
Web application with Hibernate
In this example, we will create a web application using JSP and interact with the database using hibernate framework.
Here, we will learn about generator classes.
There are many dialect classes in hibernate. Here, we will learn about the dialect classes.
Enable Logging in Hibernate
Hibernate Logging by log4j using log4j.xml file
Let's see the simple example of logging by log4j using xml file.
Hibernate Logging by log4j using log4j.properties file
Let's see the simple example of logging by log4j using properties file.
Inheritance (IS-A) Mapping
What is inheritance mapping and what are the ways to implement it.
Table Per Hierarchy using xml file
In this Hibernate tutorial, We will map the inheritance hierarchy in a single table. This uses the concept of discriminator column.
Table Per Hierarchy using Annotation
By the help of @Inheritance(strategy=InheritanceType.SINGLE_TABLE), @DiscriminatorColumn and @DiscriminatorValue annotations, we can map table per hierarchy strategy using annotation.
Table Per Concrete class using xml file
In this Hibernate tutorial, We will map the inheritance hierarchy in three tables that have no relation.
Table Per Concrete class using Annotation
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) and @AttributeOverrides annotations are used in table per concrete class strategy.
Table Per Subclass using xml file
In this Hibernate tutorial, We will map the inheritance hierarchy in three tables that have relation.
Table Per Subclass using Annotation
@Inheritance(strategy=InheritanceType.JOINED) and @PrimaryKeyJoinColumn annotations are used in table per subclass strategy.
Collection (HAS-A) Mapping
Collection Mapping Tutorial
Here, we will see how we can map the collection element of a persistent class.
Let's map the list element using the mapping file. Here, we are containing the values in the list object not the entity reference.
One-to-many Mapping using List
Example to map one to many relationship by list.
Here, we will map the list element using bag. It is non-indexed collection.
One-to-many Mapping using Bag
Example to map one to many relationship by bag.
Let's map the set object of a persistent class using set element.
One-to-many Mapping using Set
Example to map one to many relationship by set.
Mapping map in Collection Mapping
Map containing the string objects can be mapped in hibernate using map element of class.
Many-to-many Mapping in hibernate using map
Let's see the example of many-to-many association.
Association (HAS-A) Mapping
One-to-one mapping by many to one example
Example of mapping one to one relationship by many-to-one element.
One-to-one mapping by one to one example
Example of mapping one to one relationship by one-to-one element.
Component Mapping Tutorial
Let's see what is component mapping.
Hibernate Transaction Management
Transaction Management Example
How transaction is maintained by Hibernate framework.
Hibernate Query Language
Here, we will learn about the HQL. Let's create a simple examples of HQL.
Hibernate Criteria Query Language
Let's see what is Hibernate Criteria Query Language
Hibernate Named Language
Named Query Tutorial
Here, we will learn about the named query. Let's create a simple example of named query using annotation.
Caching in Hibernate
Hibernate provides first level cache, second level cache and query cache strategies.
Hibernate Second Level Cache using EH Cache
Let's see the simple example to understand the advantage of second level cache.
Hibernate Integration with other Frameworks
Hibernate and Struts2 Integration Tutorial
Let's see the simple example of hibernate and Struts2 integration.
Hibernate and Spring Integration Tutorial
Let's see the simple example of hibernate and Spring integration.