Hibernate 7 is the latest iteration of one of the most popular Object-Relational Mapping (ORM) frameworks for Java, and it brings a suite of powerful enhancements that make it a must-know tool for modern developers. This tutorial dives into the core features of Hibernate 7, explaining how it builds on its strong foundation to enhance type safety, developer productivity, and persistence layer integration.
jpa
Hibernate example using JBang
This tutorial demonstrates how to use Hibernate with JBang to execute a sample program that interacts with a database. JBang allows us to run Java programs directly from a script without the need for a full project setup. This means no Maven or Gradle configuration—just a single file with dependencies declared inline.
How to Map Your DTO Objects with MapStruct
In this tutorial, we will learn how to map your Data Transfer Objects (DTO) using the MapStruct framework and integrate it into a Jakarta EE application. Understanding DTO Objects DTO Objects are used to decouple the database model from the view that is transferred to the client. They are intended to be immutable objects, used … Read more
Dynamic Queries with Criteria API
The Hibernate Criteria API provides a powerful and flexible way to build dynamic queries in a type-safe manner. This tutorial will guide you through creating dynamic queries using the Criteria API with practical examples.
How to find slow SQL queries with Hibernate or JPA
This article will teach you which are the best strategies to detect slow SQL statements when using an ORM such as Hibernate or its Enterprise implementation which is Jakarta Persistence API.
How to store JSON Data with JPA and Hibernate
Several databases provide varying levels of support for JSON data, including storage, indexing, querying, and manipulation capabilities. In this article we will explore how to insert and fetch JSON Data using Jakarta Persistence API and WildFly.
Using Hibernate Annotations in JPA Projects on WildFly
Hibernate annotations play a key role in mapping Java objects to database tables in JPA projects running on WildFly. However, integrating these annotations seamlessly requires proper dependencies and configurations to avoid runtime errors. The Issue with Using Hibernate Annotations in WildFly Hibernate annotations are available in Hibernate core project. Therefore, in order to compile your … Read more
Writing JPA applications using Java Records
In this article, we’ll explore how Java Records, available since Java 16, can be used in the context of JPA Application. We’ll uncover how Java Records, renowned for their simplicity and immutability, complement the flexibility and expressive querying abilities offered by the Criteria API.
How to set a custom initial value for Ids in JPA
In Java Persistence API (JPA), entities require unique identifiers for database records. JPA provides several strategies for generating these identifiers, such as IDENTITY, SEQUENCE, and TABLE. However, there are cases where you might need to set a custom initial value for these identifiers using the Table and Sequence strategy. In this tutorial, we will explore … Read more
How to set the Boolean default to true in JPA?
Java Persistence API (JPA) is a widely used technology for object-relational mapping in Java applications. While mapping Java objects to database tables, developers often need to set default values for certain attributes, such as boolean fields. In this article, we will explore different approaches to setting default values for boolean fields in JPA entities.