Home » Enterprise Java » hibernate

hibernate

Hibernate with Gradle Example

1. Introduction Hibernate is an Object-Relational Mapping (ORM) framework which acts as the transformational layer between the object-oriented programming model of Java and the table-oriented model of relational databases. In the application code, programmers deal with classes and variables, inheritance, composition, aggregates, identity, and getters/setters. On the database side, there are tables and columns, primary keys, foreign keys, join tables, ...

Read More »

Hibernate in Eclipse with PostgreSQL Example

This article will show you a simple example of how to use Hibernate in Eclipse with PostgreSQL. PostgreSQL is an object-relational database management system. It’s one of the most popular databases used in the world. Hibernate is a framework for mapping object-oriented domain model to a relational database. Hibernate handles persistent database accesses with high-level object handling functions. 1. Assumptions ...

Read More »

Hibernate SQL Parameter Values using Log4j Example

When using Hibernate, if developers log the Hibernate SQL statements, they will see something like this: Hibernate: insert into student (id, first_name, last_name, email) values (?, ?, ?, ?) However, for debugging the application, developers want to see the actual parameter values in the Hibernate logs i.e. basically, they want to get rid of the question marks in the logs. ...

Read More »

Hibernate Session byId Example

Hibernate Session provide different methods to fetch the data (or a single record) from the database. In this tutorial, we will demonstrate the use of Session.byId() method in Hibernate using the annotation based configuration. 1. Introduction 1.1 Hibernate Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a ...

Read More »

Hibernate Load Example

Hibernate Session provide different methods to fetch the data (or a single record) from the database. Two of them are – get() and load(). The functionality is similar but there is a difference between the ways they work. In this tutorial, we will demonstrate the use of load() method in Hibernate using the annotation based configuration. 1. Introduction 1.1 Hibernate ...

Read More »

Hibernate Get Example

Hibernate Session provide different methods to fetch data (or a single record) from the database. Two of them are – get() and load(). The functionality is similar but there is a difference between the ways they work. In this tutorial, we will demonstrate the use of get() method in Hibernate using annotation based configuration. 1. Introduction 1.1 Hibernate Object-Relational Mapping ...

Read More »

Hibernate Transaction Example

A Transaction is a sequence of operation which works as an atomic unit. A transaction only completes if all the operations completed successfully. A transaction has the Atomicity, Consistency, Isolation, and Durability properties (ACID). In this tutorial, we are going to talk about the basics of Hibernate Transactions and Sessions. 1. Introduction 1.1 Hibernate Object-Relational Mapping or ORM is the ...

Read More »

Hibernate Exception Handling Example

This tutorial deals with some of the errors that developers get, while working with Hibernate. Along with the exception or error messages themselves, potential causes of these errors are often listed along with links to additional resources. In this tutorial, we will discuss the Hibernate exceptions. 1. Introduction 1.1 Hibernate Object-Relational Mapping or ORM is the programming technique to map ...

Read More »

Hibernate CRUD Operations Tutorial

A CRUD operation deals with creating, retrieving, updating, and deleting records from the table. In this tutorial we will see how it is done using Hibernate annotations. We are going to discuss 4 main functionalities: Creating a Record Displaying Records Updating a Record Deleting a Record Table Of Contents 1. Introduction 1.1 Hibernate 1.2 CRUD 1.3 Download and Install Hibernate ...

Read More »