jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ishai Borovoy <ishaiboro...@gmail.com>
Subject Re: References
Date Wed, 15 Aug 2007 18:10:38 GMT

Thanks


(Berry) A.W. van Halderen wrote:
> 
> On Wed, Aug 15, 2007 at 07:40:12AM -0700, Ishai Borovoy wrote:
>> How can I easily get all the nodes that have refer to other node?
>> For example I have Node A, B, C.
>> A has reference property to C.
>> B has reference property to C.
>> 
>> I want to get in some way (by code or by query) all the nodes that
>> reference
>> properties that refer to C. 
> 
> Assuming you use UUIDs (in A and B) and mix:referenable on C:
> 
>     Node C;
>     Set<Node> allNodesThatReferToC = new HashSet<Node>;
>     for(PropertyIterator iter = C.getReferences(); iter.hasNext(); )
>       allNodesThatReferToC.add(iter.nextProperty().getParent());
> 
> \Berry
> -- 
> Berry A.W. van Halderen           b.vanhalderen@hippo.nl /
> berry@halderen.net
> Disclaimer: the above is the author's personal opinion and is not the
> opinion
> or policy of his employer or of the little green men that have been
> following
> him all day.
> 
> 

-- 
View this message in context: http://www.nabble.com/References-tf4273547.html#a12167198
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message