A simple implementation of a nested set tree in spring boot and postgres without using recursion, just because I couldn't find any online.
Sql functions are based on the implementation in werc/TreeTraversal.
./gradlew clean build bootRun
from the projects root folder should build and run the service given the prerequisites are met.
The tech stack core of the project:
In order to run the service locally you need to have an instance of Postgresql 9.6 cluster running (either installed locally or running in a Docker container) with a database named nestedTree
.
The standard installations of the tools mentioned above will suffice.
On the first run the service will initialize the local database with the necessary table structure.
Running this docker command will get you a Postgres instance that needs no further configuration:
docker run --name=nestedTree -e POSTGRES_PASSWORD=CHANGEME -e POSTGRES_USER=CHANGEME -e POSTGRES_DB=nestedTree -p 5432:5432 -d postgres:9.6