Modeling self-referencing associations with Hibernate
|

Modeling self-referencing associations with Hibernate

When you model a hierarchical data structure, you often have to use self-referencing associations. Both ends of these associations are of the same type. In other words, the entity object on which the association is defined and the one the association references are of the same type. In your database, you model that using a…

Ternary Associations – Modelling Associations between 3 Entities

Ternary Associations – Modelling Associations between 3 Entities

An association between 3 entities is called a ternary association. A typical example is an association between an employee, the project they are working on, and their role in that project. If the role is a complex object, you might decide to model this as 3 entity classes. The association between them is the interesting…