I would like to create a dynamic and universal superclass with JPA / hibernate, which will be expanded for each hierarchical structured model, such as: role, page, directory, department, resolution, tree. I would like to create a dynamic tree with this object using java recursion and reflection
it should look like this:

This object must have a reference to its own entity.
I would like it to be completely abstract and not have a db table. Only extended objects must have db.
I tried to achieve this. But for so long. Here is my post about it
I am considering solutions:
- @Inheritance (strategy = InheritanceType.TABLE_PER_CLASS)
- @ Ani and @AnyMetaDef display
- @MappedSuperclass
- @Embeddable and @Embedded
I hope someone offers some suggestions.
source share