Introduction: As an object-oriented developer, we want to avoid having larger classes with tons of unrelatable fields. And so, we might often feel the need to represent a JPA Entity using multiple objects. In this quick tutorial, we’ll learn how to achieve it using @Embedded and @Embeddable annotations in JPA or Hibernate. Context Buildup: Let’s […]
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 […]
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) […]