Skip to content
Thorben Janssen
  • BlogExpand
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • AboutExpand
    • About
    • Talks
    • Contact
Sign In
Thorben Janssen

AssociationMappingPage-AssociationTypes

  • Mapping Collections with Hibernate and JPA
    Hibernate Advanced | Hibernate

    Mapping Collections with Hibernate and JPA

    ByThorben Janssen

    JPA and Hibernate provide 3 main options to map a Collection. If it’s a Collection of other entities, you can model it as a to-many association. This is the most common mapping. But you can also map it as an @ElementCollection or as a basic type. In this article, I will show you all 3…

    Read More Mapping Collections with Hibernate and JPAContinue

  • Modeling self-referencing associations with Hibernate
    Hibernate Advanced | Hibernate

    Modeling self-referencing associations with Hibernate

    ByThorben Janssen

    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…

    Read More Modeling self-referencing associations with HibernateContinue

  • Ternary Associations – Modelling Associations between 3 Entities
    Hibernate Advanced

    Ternary Associations – Modelling Associations between 3 Entities

    ByThorben Janssen

    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…

    Read More Ternary Associations – Modelling Associations between 3 EntitiesContinue

  • How to map an association as a java.util.Map
    JPA | Hibernate Advanced

    How to map an association as a java.util.Map

    ByThorben Janssen

    The java.util.List<SomeEntityClass> is the most common representation of a to-many association with JPA and Hibernate. But is it also the one that you want to use in your domain model? Does it fit your use cases or do you need smarter access to the associated elements? Let’s be honest, a simple java.util.List is good enough…

    Read More How to map an association as a java.util.MapContinue

Join the Newsletter

Join 10k+ subscribers to get a persistence tip every weekday.

I will collect, use and protect your data in accordance with my privacy policy.

Level up your skills!

  • In-depth courses
  • Expert sessions
  • Monthly persistence news
Learn more!
Twitter YouTube Github Facebook Xing Linkedin
  • Disclaimer
  • Privacy Policy
  • Terms of Service
  • Imprint
  • Contact
  • Change privacy settings
  • Privacy settings history
  • Revoke consents

© 2025 Thorben Janssen, all rights reserved.

  • Blog
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • About
    • About
    • Talks
    • Contact
Search