Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:03:16+00:00 2026-06-11T10:03:16+00:00

It is good to use Nested sets for the hierarchical data. But in this

  • 0

It is good to use Nested sets for the hierarchical data. But in this design you should calculate always the right and the left nodes if you delete or insert some data. Additionally you don’t have any foreignkeys.

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:03:17+00:00Added an answer on June 11, 2026 at 10:03 am

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

    The RIGHT and LEFT values you could update in your application/model, or through PrePersist/PreUpdate/PreRemove events.

    Another option is to use an exploded table instead. For that you just need to add an allChildren relationship that uses a ManyToMany join table. When you add a child to any node, you just need to add the child to all of its parents.

    Yet another option is to just use a hierarchical query in your database, such as a CONNECT BY clause in Oracle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a project which involves a good use of core data. I
Is it good to use float in table less design? What is the pros/cons
How to do a parsing of nested nodes with NSXMLParser. Since this parser is
This is probably a dumb question, but I can't seem to find a good
I have a large nested that selects new classes, which works good, but I
This question is more about the algorithm and the right use of function rather
Is it good/bad practice to use deep nested options when creation a jquery.ui.widget Something
I like to get inspiration from using web applications that make good use of
Is it good to use such approach for keeping read-only list of string, for
Is it good to use an autoloader that load root/app/model/test.php when trying to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.