If a database table has more than one column as the primary key then we call it as composite primary key. In this Hibernate Composite Primary Key tutorial, we will learn how to define Composite Primary Key using <composite-id> tag and Annotations. … [Read more...]
Hibernate Inheritance – Table Per Subclass Hierarchy (XML Mapping & Annotation)
In the previous example we have seen Table per Class Hierarchy strategy, there we will be having a single table for both the Parent class and the Sub class separated by a discriminator column. In this Table per Subclass Hierarchy Example, subclass table will be mapped to the Parent class table by primary key and foreign key relationship. … [Read more...]
Hibernate Many To Many Mapping Example – Annotation
In this Hibernate Many To Many Mapping Example, we will learn how Hibernate Many To Many relationship works(Using Annotation). Let's take the Example of Employee and Department, one Employee can be part of many Departments and similarly, one Department can have many Employees. Let's dig into the code. … [Read more...]
Hibernate One To One Mapping XML Example with Foreign Key
In the previous article, we have learnt about Hibernate One To One Mapping With Primary Key. In this Hibernate One To One Mapping with Foreign Key. … [Read more...]
Hibernate Hello World Example in Eclipse (Annotation)
In the previous article, we wrote our first Hibernate Hello World Example using XML Mapping, configuring hibernate through XML configuration is a bit complex process this can be done easily if we are using Annotation. In this Hibernate Hello World Example, we will learn how to write a simple Hibernate application using JPA Annotations. … [Read more...]