jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alartin <alar...@gmail.com>
Subject Node mapping question: when should I use subnode?
Date Wed, 21 Mar 2007 10:15:24 GMT

Hi all,
  I am trying to write a QnA (question and answer) demo of jackrabbit and
have a few questions about Object and Content Mapping.
  Given three objects: qeustion, answer, and comment. One question may has
many answers and comments; one answer may have many comments. Answer and
comment can not exist alone.
  In OCM, I have two choice:
1. subnodes:
            1 root -- 1 my:qna -- * my:question 
                                                    |__  * my:answer  ___
                                                    |__  * my:comment    |__
* my:comment
2. same level(use reference):
            1 root -- 1 my:qna -- 1 my:questions
                                                             |__ *
my:question
                                       -- 1 my:answers
                                                             |__ * my:answer
                                       -- 1 my:comments
                                                               |__ *
my:comment
   I can use the multi-value property to store the references. For example,
one my:question has a multi-value property named "answers" and each value is
the uuid of one my:answer node and each my:answer hold the uuid of the
question node.
My question is : what's the difference between the two choice?
If I need do a lot of access or calculating to answers or comments, is it
better to choose the 2th choice? Thus, I do not need to iterate all
questions to find all answers or comments.
The second question is: Is it important to make a single my:questions
node/my:answers node/my:comments node?
If not, there are many different nodes in one level. Is it a big problem in
the future such as searching performance?
Many thanks!
-- 
View this message in context: http://www.nabble.com/Node-mapping-question%3A-when-should-I-use-subnode--tf3439621.html#a9590761
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message