Hibernate Tutorials

Hibernate in Web Application

We can use hibernate in the web application. By using hibernate in the web application we use the NetBeans IDE to create and deploy a web application that displays data from a database. Hibernate uses web applications as the persistence layer and also used for retrieving and storing Plain Old Java Objects (POJOs) to a […]

Caching Objects in Hibernate

The caches are used to improve the performance of hibernate web applications by optimizing the database applications. The cache stores the already loaded data from the database. This helps to reduce the traffic between our application and database when the application wants to access that data again. Because the time needed to access the database […]

Batch Processing and Native SQL

The execution of series of programs is called batch processing. Batch processing is the process of reading data from a persistent store, doing something with the data, and then storing the processed data in the persistent store. It permits the automation and sharing of computer resources and usually run when computer resources are less busy. […]

Hibernate Criteria Query

Hibernate criteria API is a type of method which permits to create a criteria query object programmatically where you can apply filtration rules and logical conditions. The criteria query with examples listed below will give a better insight on how to use criteria queries in hibernate .The Hibernate Session interface uses createCriteria() method which can […]

Hibernate Query Language

Hibernate query language (HQL) is an object oriented query language. HQL is similar to SQL and it is case-insensitive except from the java classes and properties. Keywords like SELECT, FROM and WHERE etc. are not case sensitive but properties like table and column names are case sensitive in HQL. For understanding the HQL syntax, The […]

Hibernate Inheritance Mapping

Hibernate provide the three basic inheritance mapping strategies. They are Table per class hierarchy Table per subclass Table per concrete class Mixing inheritance Table per class hierarchy Here the table has one row for each field in the entire class hierarchy. You will have plenty of potential null values and you have a discriminator column […]

Hibernate Component Mapping

A component is a contained object that is persisted as a value type, not an entity reference. In hibernate the components are reused in different context and purposes. The component mapping can be done in different ways. They are Dependent Objects Collection of dependent objects Components as Map indices Components as composite identifiers Dynamic components […]

Hibernate One to Many and Many to Many Associations

This section describes the different associations in hibernate.They are basically one to many and many to many associations. One to Many Association One-to-many relationships occur when each record in Table A (Author) may have many linked records in Table B (Books) but each record in Table B may have only one corresponding record in Table […]

Hibernate Collection Mapping

Hibernate permits collection mapping as value type. The collection are mapped into a separate table but are not disclosed as entity on the Java side in the hibernate collection mapping and it supports the following interfaces.There are examples listed here on collection mapping. java.util.Set – java.util.HashSet is used to store value. java.util.SortedSet – java.util.TreeSet is […]

Hibernate Handling Associations

There are different associations that hibernate handles. These are explained in details below. One to One Association One to one association is done by using two keys. Primary key association Foreign key association Association mapping of one to one is done in different methods. Unidirectional association Unidirectional association with join tables Bidirectional association Bidirectional association […]

Hibernate Object Identifier

Hibernate has different object Identifiers.Hibernate provide different class objects.  They are Configuration object SessionFactory object session object Transaction object Query object Criteria object         1)      Configuration object The first Hibernate object is the configuration object. We can create this object in any Hibernate application and usually created once during application initialization. The […]

Hibernate Object Relational Mapping

Hibernate is an open source object/relational mapping tool for Java environments. The aim of hibernate is to remove the majority of the drudgery and time consuming repetitive coding. Mapping means Java classes to database tables is accomplished through the configuration of an XML file or by using Java Annotations. The term object/relational mapping (ORM) refers […]

Hibernate Basics

Hibernate is an open source ORM (Object Relational Mapping) framework helps to move from object oriented programming to relational databases. For a beginner in Hibernate , this  page will provide a quick overview about the different concepts in  Hibernate. SessionFactory It is a threadsafe (immutable) cache of compiled mappings for a single database and also […]

Hibernate Interview Questions

This section focuses on the Hibernate interview questions and answers. These hibernate questions will improve your knowledge about how and why certain things are done in the hibernate world. What is Hibernate? Hibernate is a powerful, high performance object/relational persistence and query service. This lets the users to develop persistent classes following object-oriented principles such as […]

Hibernate Criterion

Hibernate offers a set of APIs that map the SQL functionality to objects. This allows programmers to use an entirely object-oriented approach without falling back on a relational methodology

Hibernate Tools for Eclipse and Ant

Working with Hibernate is very easy and developers enjoy using the APIs and the query language. Even creating mapping metadata is not an overly complex task once you’ve mastered the basics. Hibernate Tools makes working with Hibernate or EJB 3.0 persistence even more pleasant. Hibernate Tools is an entirely new toolset for Hibernate3 (see this […]

Configuring Hibernate

Using XML files for configuring hibernate application is the most widely used approach. This is simple one and less changes needed in the future. There is two types of configuration we can do using XML files. one is non-managed environment and another one is for managed environment. Here we will explain about the non-managed environment […]

What is Hibernate

Hibernate is popular open source object relational mapping tool for Java platform. It provides powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate lets you develop persistent classes following common Java idiom – including association, inheritance, polymorphism, composition and the Java collections framework. Hibernate lets you develop persistent classes following common Java idiom […]