Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 16237 invoked from network); 16 Feb 2011 05:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2011 05:03:37 -0000 Received: (qmail 78785 invoked by uid 500); 16 Feb 2011 05:03:37 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 78438 invoked by uid 500); 16 Feb 2011 05:03:34 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 78430 invoked by uid 99); 16 Feb 2011 05:03:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 05:03:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of umashanthip@gmail.com designates 209.85.160.170 as permitted sender) Received: from [209.85.160.170] (HELO mail-gy0-f170.google.com) (209.85.160.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 05:03:28 +0000 Received: by gyf2 with SMTP id 2so412686gyf.1 for ; Tue, 15 Feb 2011 21:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rOp+juyV8Ls13pNYf0/BAS275F1ExcUWbmqlfO9UNcw=; b=qdYRX5hb6v23i4AxstwbyCqpwQ0uwAcewAeQPGOyNQRzBLUhcZ0xvkkEbwvWXFtamx TOLYnwwYS1O3XraKXZZdwxi5byyGKPjaMxfpug12vjViO42k+uQUktW0RPDNryZOfMqK I0+W4O3TnP6XmzH5JMOyj2b7F7HPuHuywDO6o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RjSXPA1msw7ZmtbPhCJE1xrAiN3dMdQg61MMYqX49P7tPKO1IOHnWJ1MlrO8MPM4hk szUGXxvMh7jwr1qAr6Vk4JCom7TlG3+OkscCJxrHCzo2rBLVvCWWCjIieJ6IZxdIdcSr XyKZsxqMs3Nup1+2Nq7RYldC4ybL3UcfD7KVM= MIME-Version: 1.0 Received: by 10.100.212.5 with SMTP id k5mr60233ang.3.1297832587486; Tue, 15 Feb 2011 21:03:07 -0800 (PST) Received: by 10.100.46.1 with HTTP; Tue, 15 Feb 2011 21:03:07 -0800 (PST) In-Reply-To: <3398CD82-DD30-48B3-9D5D-C36C3251B850@sptci.com> References: <3398CD82-DD30-48B3-9D5D-C36C3251B850@sptci.com> Date: Wed, 16 Feb 2011 10:33:07 +0530 Message-ID: Subject: Re: Linking JCR Nodes From: Umashanthi Pavalanathan To: users@jackrabbit.apache.org Cc: Rakesh Vidyadharan Content-Type: multipart/alternative; boundary=0016368e1c315ae498049c5f327f --0016368e1c315ae498049c5f327f Content-Type: text/plain; charset=ISO-8859-1 On Wed, Feb 16, 2011 at 9:28 AM, Rakesh Vidyadharan wrote: > > On 15 Feb 2011, at 20:33, Umashanthi Pavalanathan wrote: > > > Hi , > > > > Jackrabbit's JCR implementation is used in the project I am working on. > > I have got a question about linking two JCR nodes; is there any concept > of > > association/link between two nodes? > > The basic requirement is to create a conceptual connection between two > nodes > > and should be able to retrieve all nodes associated with a node (not the > > case of parent-child nodes; but mostly sibling nodes). I would like to > know > > whether there's any such concept in JCR/Jackrabbit implementation. If > there > > is such feature, I would be glad if you can provide me some links to > > resources. > > I am not too sure about what you are trying to achieve, but you can store > properties in your nodes that can be used to very efficiently retrieve > matching nodes. If you have custom node types, these properties can be auto > created as well. > > Another way of linking is to store node references as path, weakreference > or even a hard reference in your nodes. > My requirement is like this. I represent a *Person *by a node. There are many such *Person *nodes connected with a single *Person* node ( say for eg: friends for that person). I want to build such a relationship/association with the *Person *type nodes. As I understood, keeping a list of node references of other nodes is one option. But I am not sure how much feasible it will since that list might grow and shrink vastly. Can you please explain about the concept of Reference and WeakReferences [1][2] ? [1] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Node.html#getReferences(java.lang.String) [2] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Node.html#getWeakReferences() Thanks, ~Umashanthi > Rakesh --0016368e1c315ae498049c5f327f--