Hibernate Tutorial

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 […]

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 […]

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 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 (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 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 […]

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 […]

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 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 […]

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 […]