A "Nested Sets" tree implementation for hierarchical structures in a database table.

See

The NestedSetsTreePojo and TemporalNestedSetsTreePojo classes in this package provide methods to access database tables as trees. The NestedSetsTree and TemporalNestedSetsTree interfaces describes the responsibilities of a domain object against the DAO.

There can be more than one tree in one database table. You can not move a tree from one database table to another, but you can move trees (or sub-trees) within one table. The DbSession interfaces is to abstract the persistence layer from the DAO.

As it is not easy to define unique constraints for trees in database tables, there is an interface UniqueTreeConstraints that describes the responsibilities of such a check. You can pass an implementation of that interface to the DAO for checking uniqueness. Example is UniqueTreeConstraintsImpl. Unit tests, sample POJOs and a Hibernate DbSessionImpl are in parallel test-package (TODO should be in Maven src/test/java directory).

See JNestedSetsTree.html manual in this package for further details.

Glossary

DAO = data access object
POJO = plain old Java object, domain object