-->
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.  [ 4 posts ] 
Author Message
 Post subject: One to many pointing to itself?
PostPosted: Wed Jan 20, 2010 12:52 am 
Beginner
Beginner

Joined: Wed Mar 19, 2008 12:10 am
Posts: 36
I am creating message board with two objects, ParentPost and ReplyPost.

I am thinking about changing it to just all be in one Post object so that it would be easier to do a single order by instead of having to do it twice and comparing the results (is there a "quick" way to do that?)

Is there any kind of performance reason to split them up vs having them in one object?

Thanks


Top
 Profile  
 
 Post subject: Re: One to many pointing to itself?
PostPosted: Wed Jan 20, 2010 7:23 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Please explain you problem a little more in detail?
What do you mean with 'One to many pointing to itself' ?


Top
 Profile  
 
 Post subject: Re: One to many pointing to itself?
PostPosted: Wed Jan 20, 2010 9:30 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
It's clearly a one to many relationship, so map it that way.

If you're really interested in such a program, look at JForum and their database to get ideas of how some real industry experts have tackled such problems. May as well learn from the best.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: One to many pointing to itself?
PostPosted: Mon Jan 25, 2010 11:12 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Yes, considering that a post (ParentPost) can receive more than one reply (ReplyPost)
you must model it as OneToMany


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.