Home » Tag Archives: Hibernate

Tag Archives: Hibernate

Hibernate Many To Many Tutorial

Introduction: In this tutorial, we’ll learn to define and use a many-to-many entity association using Hibernate @ManyToMany annotation. Context BuildUp: To follow along with this tutorial, let’s say we have two entities – Employee and Qualification: As we know, one employee can multiple qualifications. Also, there can be N number of employees with a specific qualification. It clearly means that the Employee and Qualificationentities share a Many-to-Many relationship. Maven Dependencies: In ...

Read More »

Identifiers In Hibernate

Introduction: Identifiers in Hibernate model the primary key attribute of an entity. It helps us to uniquely identify a JPA entity. Every entity must define an identifier. Also, it can be either simple or composite. We can define a Hibernate identifier in several ways. In this tutorial, we’ll learn how to do so. Simple (Single-Valued) Identifier: If we have a ...

Read More »

Spring Boot Hibernate Tips

spring-interview-questions-answers

1. Overview Hibernate needs no introduction. It is the most popular ORM out there for Java. Similarly, Spring Boot is the most powerful, and easy to use framework out there for Java. This tutorial isn’t about Hibernate or Spring Boot, there are tons of them out there. We’ll look into some common errors that you may run into when using ...

Read More »

How to map PostgreSQL Enums to JPA entity properties using Hibernate

Introduction The open-source hibernate-types project allows you to map JSON, ARRAY, YearMonth, Month or database-specific columns (e.g. INET addresses). In this article, we are going to see how you can map a PostgreSQL Enum type to a Java array when using JPA and Hibernate. Maven dependency First of all, you need to set up the following Maven dependency in your ...

Read More »

Spring Hibernate Tutorial

spring-interview-questions-answers

1. Introduction In this post, we shall demonstrate how to leverage the power of one of the most popular ORM (object-relational mapping) tool, Hibernate which facilitates the conversion of an object-oriented domain model to a traditional relational database. Hibernate is one of the most popular Java frameworks out there. For this reason we have provided an abundance of tutorials here ...

Read More »

JPA Tips: Avoiding the N + 1 select problem

java-interview-questions-answers

Introduction ORM frameworks like JPA simplifies our development process by helping us to avoid lots of boilerplate code during the object <-> relational data mapping. However, they also bring some additional problems to the table, and N + 1 is one of them. In this article we will take a short look at the problem along with some ways to ...

Read More »

Spring Boot & JPA & Hibernate & Oracle

java-interview-questions-answers

In this tutorial we show how to create a Spring Boot application that communicates with an Oracle data source through Hibernate. Prerequisites: Eclipse IDE (neon release) Maven 4 Java 1.8 1- Create maven project Open eclipse, then create a new maven project and name it as SpringBootHibernate. At the end of this tutorial, we’ll get the following project structure: 2- ...

Read More »