jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alartin <alar...@gmail.com>
Subject Should I use property type: reference or string?
Date Thu, 22 Mar 2007 09:33:06 GMT

Hi all,

  Briefly speaking, I have a "question" object, it has a reference(Java
concept) of a "user" object and a reference of a list of "answer" objects.
On the other hand, "user" object also has a reference of a list of
"question" objects and a reference of  a list of "answer" objects: "user" 1
<--> * "question", "user" 1 <--> * "answer".
My questions are:

1. The reference type of property is only for integrity constraint, it is
much more like primary/foreign key in RDBMS rather than the reference
concept in Java(OO)?

2. If above is true, should I only use reference type of property when I
need to maintain the integrity, for example: when I delete a user, all his
questions and answers must be deleted too. Thus, a user node should be
referenceable and it is the target of a question node's "author" property
with reference type

3. If I do not need that, I should use a string type instead of reference
type: a question node's "author" property is string type and the value is a
"user"'s name (suppose it is unique)

4. If a node need to maintain a list of reference targets, I can use
multiple-value property to store the list of targets, but how can I add one
target dynamically? (I only find setProperty(String name, String[] values)
method in NodeImp class, no add method), for example what can I do if a user
node's "answers" property(multi-value and maintains targets) needs to add a
target(one answer's uuid)?

Many thanks in advance. 
-- 
View this message in context: http://www.nabble.com/Should-I-use-property-type%3A-reference-or-string--tf3446410.html#a9611072
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message