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 169835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:42:05+00:00 2026-05-11T12:42:05+00:00

Essentially, I want the user to be able to define a hierarchical model, but

  • 0

Essentially, I want the user to be able to define a hierarchical model, but then I need to allow the user to store data within their defined model. Does this make sense? So the users will be able to create new ‘unit types’ to be organised in a hierarchical way and decide how units of these types are allowed to be organised. A simple example: in my hypothetical interface a user creates three unit types, trunk, branch and leaf. The user then defines the relationships between them. A leaf can exist at any point in the hierarchy, a branch must have a trunk as a parent. The user can then creates instances of these unit types (as units) and can organise them according the rules defined in their model… is there a good way of doing this in the database?

  • 1 1 Answer
  • 3 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. 2026-05-11T12:42:06+00:00Added an answer on May 11, 2026 at 12:42 pm

    This is an extremely broad question, but this may point you in the right direction. Note that you’re only going to be able to store the relationship rules in the database. Enforcing them will be up to your client code. Try this on for size..

    unit:     unit id,     name,  unit relationship:     unit id,     foreign unit id 

    You can then use your unit relationship table in the following way..

    unit id relates to the unit it’s describing. foreign unit id should be nullable.

    A unit with no relationship records can only exist at the root of the heirarchy. A unit with a null foreign unit id can have any other unit as its parent. Otherwise, a unit must have another unit as its parent, and it’s type must be one of those defined in its relationship records.

    As for storing the instances themselves, that should be straightforward..

    instance:     instance id,     unit id,     parent instance_id 

    I’m sure there would be other fields you’d need (name, for instance), but I assume you get the drift.

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

Sidebar

Related Questions

Essentially I want to be able to catch when a user lets their session
Perhaps I'm missing something here, but I want the user to be able to
Quick question: We want to be able to store a user avatar image for
I want to store a list of numbers (essentially, a set in mathematical terms)
I need to allow the web user to enter a URL for an image,
I essentially want to display a screen whenever the screen is unlocked regardless of
I've gotten myself into a situation that seems fairly unusual, and essentially want to
Essentially I want a border-less, black window which I can set the location and
Essentially I want to suck a line of text from a file, assign the
I have 3 date range forms on my site. Essentially I want to hide

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.