Category: HIBERNATE-JPA

Hibernate finds a new Home at Commonhaus Foundation

For the past two decades, Hibernate, a cornerstone of Java data persistence, has thrived under the stewardship of JBoss and Red Hat. Today, the project announces a significant shift: its move to the Commonhaus Foundation, a neutral ground for open-source projects.

How to Configure Level 2 Cache in JPA Applications

In this updated article we will learn how to configure Hibernate Second Level Caches with Jakarta Persistence API to optimize database interactions. The primary objective is to minimize the frequency of database hits by strategically implementing caching mechanisms for both entities and queries within the context of the Jakarta Persistence API. Besides, we will also learn how to monitor Caches using WildFly management tools.

Hibernate 6 with Maven made simple

In this tutorial we will show how you can create an Hibernate 6 application using annotations. For this purpose we will use a basic Maven archetype and we will enhance so that it uses Hibernate dependencies and MySQL as database.

Hibernate @SoftDelete Step-by-Step Guide

@SoftDelete annotation, introduced in Hibernate version 6.4, provides first-class support for soft deletes, allowing to logically mark rows rows as deleted without actually removing them from the Database. In this tutorial we will see a proof of concept example of @SoftDelete and its common configuration attributes.

Getting started with Hibernate Search

Hibernate Search is an extension of Hibernate, a popular Object-Relational Mapping (ORM) framework for Java applications. It provides full-text search capabilities by integrating with powerful search libraries like Apache Lucene or Elastic Search. In this tutorial we will learn how to create a sample application using Hibernate Search.

Many to Many Hibernate/JPA Example

In Java Persistence API (JPA), the Many-to-Many relationship represents a common scenario where multiple instances of one entity are associated with multiple instances of another entity. This tutorial will guide you through the process of implementing a Many-to-Many relationship using JPA.

3 ways to set a Query timeout for JPA / Hibernate applications

In JPA (Java Persistence API) and Hibernate applications, queries can sometimes take a long time to execute, especially when working with large data sets. To avoid long-running queries, it’s important to set a query timeout, which limits the maximum amount of time that a query is allowed to run before it times out. In this tutorial, we will learn how to set a query timeout for JPA/Hibernate applications.

Using custom SQL for Hibernate CRUD Operations

Hibernate lets you override every single SQL statement generated with CRUD Operations. We have already covered native SQL query usage in this tutorial Using native Queries with Hibernate and JPA but you can also override the SQL statement used to load or change the state of entities. Let’s see how.