Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 1080 invoked from network); 15 Nov 2007 13:45:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 13:45:30 -0000 Received: (qmail 9381 invoked by uid 500); 15 Nov 2007 13:45:17 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 9358 invoked by uid 500); 15 Nov 2007 13:45:17 -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 9348 invoked by uid 99); 15 Nov 2007 13:45:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 05:45:16 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefan.guggisberg@gmail.com designates 209.85.146.177 as permitted sender) Received: from [209.85.146.177] (HELO wa-out-1112.google.com) (209.85.146.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 13:45:07 +0000 Received: by wa-out-1112.google.com with SMTP id m34so775899wag for ; Thu, 15 Nov 2007 05:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=O9Yx+jw2VlncbkQ+kUln270na3wOZQSan+orcA2diwU=; b=nRG1a5v111ZiTDMBgeogbgLjnqO+6X6YDAHpLuLJVoQLtf7zmYkDYl+Lzoxd3Kbn3KvkZRJx83ZEjdsrWNzovXcWn3x0gvhV7uem0KVSpJ0v1DlGFD7DAhdiKiWedQHuPtdGlo9zexBUiVP4wQVQ9Pkuvu57cqzUtJGXNM8IEOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WUtpZl01GdkysWYSSiPbhLklcopabwl9aDWJpHIArlF9BE5zhDwenyfuQVaZufz+vnFBfdqjpGa7vVNmQfSy0FIl0mGOez9Wad8pkrlzZ1j4TVT93Jysm9bEXOSQFrRZi9enfq1mYALwoTHp+nw9z54w1T/Ds9rg14NDiITTVyU= Received: by 10.114.52.1 with SMTP id z1mr307829waz.1195134301358; Thu, 15 Nov 2007 05:45:01 -0800 (PST) Received: by 10.114.179.2 with HTTP; Thu, 15 Nov 2007 05:45:01 -0800 (PST) Message-ID: <90a8d1c00711150545g2101f694yb5c210c41321dbd@mail.gmail.com> Date: Thu, 15 Nov 2007 14:45:01 +0100 From: "Stefan Guggisberg" To: users@jackrabbit.apache.org Subject: Re: Multi-Value properties of type REFERENCE In-Reply-To: <7d3e1a010711130740g365a93d1u4398c46f88151230@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13727497.post@talk.nabble.com> <7d3e1a010711130740g365a93d1u4398c46f88151230@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Nov 13, 2007 4:40 PM, Brian Thompson wrote: > Could you explain more about the data you need to model and why the MODEL, > MCODE, and TOPIC types have the relationships you described? In my > experience, it's usually not necessary to use a lot of references in a > repository. If you're used to modeling things in a DB, it's natural to look > at references to link nodes, but most use-cases are pretty well handled by a > good node structure. i absolutely agree with brian. > > As for using multi-valued REFERENCE properties, I think you could do that in > the same way as you'd use any other multi-valued property. Just construct > an array of Value objects holding the REFERENCES and pass that into > setProperty(). that's correct. heres's an example (using String[] instead): // creating references Node target1 = ...; Node target2 = ...; Property refs = node.setProperty("refs", new String[]{target1.getUUID(), target2.getUUID()}, PropertyType.REFERENCE); session.save(); // dereferencing ... Value[] values = refs.getValues(); for (int i = 0; i < values.length; i++) { Node target = session.getNodeByUUID(values[i].getString()); ... } cheers stefan > > I haven't actually tried this, so there might be a problem I don't > foresee...I'm sure more knowledgeable members of the community will chime in > shortly :) > > -Brian > > > > > > On Nov 13, 2007 9:02 AM, Kisu San wrote: > > > > > Dear All, > > > > I want to implement many to many relationship between nodes. I have the > > following scenario > > > > I have three nodes MODEL, MCODE, TOPIC. > > > > relation between MCODE and TOPIC are many to many. A MCODE 'P1202' can > > have > > relationship to TOPIC 'RX003' and 'RX0054'. TOPIC 'RX0054' can have > > relationship with MCODE 'P1202' and 'P1206' > > > > In this case, I have property called tpCode on TOPIC node, which I want to > > REFER to MCODE nodes 'P1202' and 'P1206'. > > > > Would this be possible in Jackrabbit? > > > > Does Jackrabbit support Multi-value properties of type Reference? > > > > If yes, how can I implement this? If no, what is the work around for this? > > > > Thanks in advance > > -Kishore > > > > > > >