Home » Enterprise Java » hibernate

hibernate

Hibernate Envers Example

In many business applications, it is of utmost important to track the audit log, when and who has done the changes to the data. There are multiple approaches to achieve it. Hibernate Envers is one of the ways to achieve it. In this article, we will study the Hibernate Envers. Envers are part of the Hibernate Core module. They aim ...

Read More »

Hibernate Show SQL Example

This is another example of the hibernate series. Here, we feature a comprehensive article about the Hibernate Show SQL. Hibernate is a feature-rich Object Relational Mapping tool. It offers very fine-tuned debugging capabilities by enabling logs at various levels. In this article, I am going to show how SQL queries can be printed in a hibernate application. 1. Hibernate Configuration ...

Read More »

Hibernate Inheritance Mapping Example

In this post, we feature a comprehensive article about Hibernate Inheritance Mapping. Inheritance is one of the fundamental design principles o Object-Oriented Languages. In Java, it is very common to have inheritance implemented in domain models. However, relational databases don’t support inheritance and they support flat structure. Java Persistence API suggests different strategies to support inheritance hierarchies. In this article, ...

Read More »

Hibernate Configuration Example

In this post, we feature a comprehensive article about Hibernate Configuration. Working with an Object-Oriented Language and relation database can often be cumbersome and Object Relational Mapping frameworks are built to solve this problem. Hibernate is one of Java’s Object Relational Mapping framework. It abstracts us from underlying database implementations and application can be ported to other databases easily with ...

Read More »

Hibernate Many to One Mapping Example

Welcome readers, in this tutorial, we will discuss the Hibernate many to one relationship mapping. As the name suggests, Many to One entity-relationship shows the association of multiple entities with a single entity. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a Java-based ORM tool ...

Read More »

Hibernate doReturningWork() method Example

In this tutorial, we will learn Hibernate 4 Returning Work interface and Session.doReturningWork() method for Jdbc. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a Java-based ORM tool that provides the framework for mapping application domain objects to the relational database tables and vice versa. ...

Read More »

Hibernate doWork() method Example

In this tutorial, we will learn Hibernate 4 Work interface and Session.doWork() method for Jdbc. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a Java-based ORM tool that provides the framework for mapping application domain objects to the relational database tables and vice versa. It ...

Read More »

Hibernate CascadeType.PERSIST Example

Greeting readers, in this tutorial, we will create two entity classes related to each other and we will perform the cascading operations between them. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a Java-based ORM tool that provides the framework for mapping application domain objects ...

Read More »

Hibernate CascadeType.REMOVE Example

Greeting readers, in this tutorial, we will create two entity classes related to each other and will perform the cascading operations between them. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a Java-based ORM tool that provides the framework for mapping application domain objects to ...

Read More »

Hibernate Optimistic Locking Example

In hibernate, Locking represents a mechanism to safeguard the records that can be simultaneously accessed to avoid the concurrency errors (i.e. when multiple users simultaneously update the records resulting in inconsistencies). Hibernate has two types of locking mechanisms i.e. Optimistic locking Pessimistic locking In this tutorial, we will explore the optimistic locking mechanism in the hibernate framework. 1. Introduction Object-Relational ...

Read More »