Hierarchical trees with PostgreSQL and Spring Data JPA



This content originally appeared on DEV Community and was authored by Mircea Cadariu

He who plants a tree,
Plants a hope.
Lucy Larcom, Plant a tree 🌳

In this post, I offer you a guide for modelling a hierarchical tree in your application. I’ll show you a couple of approaches for implementing it, and analyse some operational characteristics pertaining to each. To mention some examples – a hierarchical tree structure is applicable for example when you need to implement things like file systems (each folder can have several files), or organizational charts (manager-employee relationship).


This content originally appeared on DEV Community and was authored by Mircea Cadariu