How to load hibernate.cfg.xml from different directory

Hibernate XML configuration file “hibernate.cfg.xml” is always put at the root of your project classpath, outside of any package. If you pl...

Hibernate Batch Processing Tutorial with examples

Consider a situation when you need to upload a large number of records into your database using Hibernate. Following is the code snippet to...

Hibernate Criteria Tutorial with examples

Hibernate provides alternate ways of manipulating objects and in turn data available in RDBMS tables. One of the methods is Criteria API wh...

Hibernate Named Query Tutorial with examples

Named queries in hibernate is a technique to group the HQL statements in single location, and lately refer them by some name whenever need ...

Hibernate Query Language (HQL) Tutorial with examples

Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL wo...

Hibernate Caching Tutorial with Examples

Caching in Hibernate One of the major benefit of using Hibernate in large application is it’s support for caching, hence reducing databa...

Hibernate Transaction Management Tutorial with Examples

Hibernate Transaction Management A transaction simply represents a unit of work. In such case, if one step fails, the whole transaction f...

Hibernate Many-To-Many Mapping Using Java Annotations Tutorial with Examples

Many To Many Relationship A Many To Many relationship in Java is where the source object has an attribute that stores a collection of tar...