db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCutcheon <michaelm...@frontiernet.net>
Subject Re: Recursive Select for Discussion Forum
Date Thu, 01 Dec 2005 03:31:53 GMT
Daniel Noll wrote:

> Michael McCutcheon wrote:
>>> I would have done this by having a discussion_id / thread_id column.
>>> A discussion generally has properties of its own, so in a full 
>>> application you would presumably have a discussion or thread table 
>>> already.  Selecting all messages in that discussion then becomes a 
>>> trivial matter.
>>> Daniel
>> But then how do you maintain the hierarchy like javalobby?  i.e.:
>> <snip>
>> Don't you have to have a parent_id on each item?
> Yes, you have both.  A parent_id for threading the conversation, _and_ 
> a thread_id to make querying for the entire tree more convenient.
> Daniel
Ahhh...I think I see it now.  With the thread_id on each record, I could 
select them all, then do whatever recursion necessarry in the java code 
to line everything up...

Thanks for all the suggestions everyone, it really helps.


View raw message