jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: Jackrabbit Reference Lookup
Date Sat, 07 May 2011 20:09:59 GMT
On Sat, May 7, 2011 at 12:14 AM, kazim_ssuet@yahoo.com
<kazim_ssuet@yahoo.com> wrote:
>
> Stefan Guggisberg wrote:
>>
>> i can't follow you here.
>>
>> forward lookup => referenceProperty.getNode()
>>
>> the internal value of a refererence property *is* the unique identifier of
>> the target node, i.e. the target node is *directly* accessed using its
>> unique identifier.
>>
>
> When I look at blob column of a row in REFS table there are miltiple of
> following entries in it:
>
> K64605997-e298-4334-a03e-673fc1de0911/{http://www.abc.com}resinforef

yes, those are the id's of the REFERENCE properties referring to the
target node
(identified by the id column).

>
> where "64605997-e298-4334-a03e-673fc1de0911" is the node id of referencing
> node and and "{http://www.abc.com}resinforef" is the name of property that
> references target node.

there's no such thing as a 'referencing node' in jcr/jackrabbit. only properties
(of type REFERENCE) can refer to a (mix:referenceable) node.

>
>
> But when I look at the blob of referencing node, I don't see any node id in
> it, which lets me think that referencing node is not keeping target node's
> id.

see above, there's no referencing node. i guess you mean the parent node
of a REFERENCE property. the REFERENCE property contains the identifier
of the target node. how that's stored is an implementation detail and shouldn't
be bothering you.

>
> so I am under the impression that on the referencing node when you say
> "referencingNode.getProperty("property_name").getNode()"...jackrabbit goes
> thru all REFS records to find referencing node id (in blob) to know which
> target node we are intrested in.

no, that's definitely not the case. i tried to explain that to you in
my previous
post.

anyway, why are you asking this? do you experience performance issues
when calling Property.getNode()?

why do you try to reverse engineer jackrabbit from the data stored on
the persistence layer?

if you're really interested in the jackrabbit internals i suggest you take
a look at the source code (that's the good thing with open source software ;).

set a breakpoint on the Property.getNode() method and step through the
implementation. that should answer all your questions.

cheers
stefan

>
> All this thought b/c I don't see target node id in referencing node's blob.
> If referencing node keeps target node's id then why is it not in blob of
> referencing node? and where is it stored?
>
> Hope I make sense this time.
>
> Thanks,
> KS.
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Reference-Lookup-tp3494206p3504460.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Mime
View raw message