Hibernate Tutorials

Introduction to HibernateUtil and the SessionFactory Interface

HibernateUtil is a convenience class for obtaining the Hibernate SessionFactory instance, which are used for building hibernate sessions. Hibernate sessions themselves are not thread safe i.e. there exists only one per thread of execution (used once and then discarded). A typical HibernateUtil class looks like: [crayon-5b2b153b0211c078528501/] Some important points worth noting regarding the SessionFactory:...

Hibernate configuration and mapping file

There are several ways to configure Hibernate. Having the HibernateUtil convenience class ready as we had learnt earlier in the previous post, we can go ahead using it to configure the Hibernate application with the Oracle Database. Note the following line in the HibernateUtil class, [crayon-5b2b153b02aed078397482/] This would search for the Hibernate...

Introduction to Java Persistence API (JPA)

The Java Persistence API, better known as JPA, provides POJO persistence model for Object Relational Mapping (ORM). It is basically a framework for managing relational data. You might be thinking over the relationship it has with Hibernate. Actually, Hibernate is one of the most popular framework that implements JPA. The...
Receive our updates to your inbox

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.