How to Mirror JPA Nesting Models

It’s good to use Nested Sets for hierarchical data. But in this design, you should always calculate the right and left nodes if you are deleting or inserting some data. In addition, you do not have any additional keys.

How can I reflect this model with JPA ?? Is it possible?

+1
source share
1 answer

I think you still want PARENT_ID, even with RIGHT and LEFT, otherwise the parent / child queries will be inefficient, or I'm not even sure.

RIGHT LEFT, /, PrePersist/PreUpdate/PreRemove.

, . allChildren, ManyToMany. node, .

- , CONNECT BY Oracle.

0

Source: https://habr.com/ru/post/1526155/


All Articles