-->
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.  [ 2 posts ] 
Author Message
 Post subject: how should I model this..
PostPosted: Thu Mar 18, 2004 7:41 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 6:59 pm
Posts: 89
Location: Somewhere in the Ghetto
I need to create a basic Question/Answer parent/child relationship, i've already got that down but I need to have

n Answers per Question

and every Answer needs to have a letter associated to it, like a, b, c, d, etc

how should I model this, who/where should I assign this letter?

I was thinking of doing it in Question.addAnswer(Answer) (all this does is add Answer to a Set and sets the parent of Anser to this (current Question)) is there any way hibernate can handle assigning this letter? or maybe it could generate it somehow, like say I have answer.ids 1,5,8,10 the id to letter mapping should be 1=a, 5=b, 8=c, 10=d


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 7:10 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use map index

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.