-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: one-to-many self references
PostPosted: Wed Jun 23, 2004 12:26 pm 
Newbie

Joined: Wed Jun 23, 2004 12:03 pm
Posts: 1
I have a situation where I have an object called OrgUnit which has a list property of other OrgUnits. In this particular situation there is a 3 level deep heirarchy structure that represents a divion > region > territory. There are two tables that this data is stored in, the org_unit and the org_unit_relationship tables.

What I cannot seem to determine is if I can execute a query such that I need the top-down results (always starting at division), but the sub items are limited by a parameter, which in my case is the role of the user. For example, if the user role 'GM' signs on, they see their Division, all if that divisions regions and all of those regions' territories. However, if a user role of 'AE' signs in, they see their division, their region and their one territory.

I'm sure I can figure out the query (even through SQL) that could find the lowest part of the tree, but I need to return the heirarchy down to that part. In other words, it wouldn't be too difficult to find the territory for the AE, but I what I really need is the division containing the region containing the territory that I am after. This info is displayed in a tree control so I cannot go backwards in the result, with the territory containing the region containing the division.

Any thoughts on if this is even possible?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.