Introduction In this article, we are going to see how to fetch recursive associations when using JPA and Hibernate. Recursive table relationships are built using self-referencing Foreign Key columns so that a record in a table can reference another record in the very same table, therefore allowing us to represent hierarchical structures using the relational model. Domain Model Let’s consider we have the following book and category tables in our database: The category table has a parent_id column that has a Foreign Key constraint referencing the id column in the very same... Read More
The post Fetching recursive associations with JPA and Hibernate appeared first on Vlad Mihalcea.