LOL. Can't believe I didn't think of that. I really shouldn't work on
projects at night after I've worked a 14 hour day. As always thank
you.

Cheers,
 Tyler

On 7/14/06, Geert Bevin <[EMAIL PROTECTED]> wrote:
Why don't you use Integer as a type instead of int, then you can use
null?

On 14 Jul 2006, at 05:33, Tyler Pitchford wrote:

> I'm trying to figure out the "best" way to handle comments in a table,
> when I want the "top" comment to be the parentId. Should I restructure
> the DB to make all "Comments" and "Articles" -> "Posts" with a type
> field? At that point, the top parentId for nesting the comments would
> be the ArticleId itself.
>
> Right now the database is setup with Articles and a Comments tables.
> The Comments table has a link to itself for a parentId. I was planning
> to set the parentId = null if it was a top level comment for nesting
> purposes, but it's not the simplest thing to do in RIFE, since the
> type is int and null definitely doesn't fit inside an int. Right now,
> I was planning to set the constraint to sparse and then manually
> execute an Insert() if the Id is -1, but I've had a hard time figuring
> out how to execute the Insert() cleanly through RIFE.
>
> So, 1) should I just refactor or 2) should I stay how I am (if so, how
> do I execute an update or stuff a null into an int?).
>
> Cheers,
>  Tyler
>
> P.S. I'd prefer to stick to whatever the norm in the market is for
> nested comments under Articles, if there is such a thing.
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://lists.uwyn.com/mailman/listinfo/rife-users
>

--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to