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

  • Home
  • SEARCH
  • 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 797061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:44:28+00:00 2026-05-14T22:44:28+00:00

Currently in my application I have a single table that is giving me a

  • 0

Currently in my application I have a single table that is giving me a bit of trouble. The issue at hand is I have a value object that is mapped to this table. When the data is returned to me as an array of value objects, I have to then loop through this array and begin my recursion by matching the ParentID to parent ObjectID’s.

The column ParentID is either null (acts a parent) or it holds the value of an ObjectID.

I know there has to be a better way to create this data structure so that I do not have to do recursive loops to match ParentID’s with their ObjectID’s.

Any help with this is greatly appreciated.

Here is the table in describe form:

+----------------+------------------+------+-----+---------------------+-----------------------------+
| Field          | Type             | Null | Key | Default             | Extra                       |
+----------------+------------------+------+-----+---------------------+-----------------------------+
| ObjectID       | int(11) unsigned | NO   | PRI | NULL                | auto_increment              |
| ObjectHeight   | decimal(6,2)     | NO   |     | NULL                |                             |
| ObjectWidth    | decimal(6,2)     | NO   |     | NULL                |                             |
| ObjectX        | decimal(6,2)     | NO   |     | NULL                |                             |
| ObjectY        | decimal(6,2)     | NO   |     | NULL                |                             |
| ObjectLabel    | varchar(255)     | NO   |     | NULL                |                             |
| TemplateID     | int(11) unsigned | NO   | MUL | NULL                |                             |
| ObjectTypeID   | int(11) unsigned | NO   | MUL | NULL                |                             |
| ParentID       | int(11) unsigned | YES  | MUL | NULL                |                             |
| CreationDate   | datetime         | YES  |     | 0000-00-00 00:00:00 |                             |
| LastModifyDate | timestamp        | YES  |     | NULL                | on update CURRENT_TIMESTAMP |
+----------------+------------------+------+-----+---------------------+-----------------------------+e
  • 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-05-14T22:44:28+00:00Added an answer on May 14, 2026 at 10:44 pm

    You could use a nested set model. See the very good explanation here: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

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

Sidebar

Related Questions

I have an application that is currently running against a 32-bit SQL Server 2005
I currently have a single solution that contains both the one application developed so
For my project management application, I am currently using Single Table Inheritance so that:
I currently have an application that gets hit with over 20,000 users daily and
Currently I have an application that receives an uploaded file from my web application.
I have a web application that currently sends emails. At the time my web
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have a table with a repeater that is being filled with data
I have an issue with single table inheritance and I'm not sure if I'm
I currently have an application which needs to have an awareness of which monitor

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.