You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sa...@bosch-si.com on 2012/04/03 10:20:38 UTC

Several questions regarding the JCR API and Jackrabbit

Hi all,

 

I have a few questions about the JCR API and the internals of Jackrabbit
and I didn`t find an answer neither in the specification nor in the
Jackrabbit wiki:

 

1)      How do I query for nodes with distinct property values? Imagine
I have couple of nodes with the same property value and I want to query
only for the distinct property values.

2)      How do I get the last version (version name is unknown) in a
version history directly without iterating over ALL versions?

a.       I tried something like: versionHistory.getVersion("1." +
(allVersionsSize - 2)) but that seems to be very ugly and I am asking if
there is no cleaner way to do this?

3)      How do I get the total amount of a QueryResult? Currently I am
casting the QueryResult to QueryResultImpl and retrieve the total amount
from there but that seems to only work for XPath queries. When using
SQL2 queries you get another QueryResult which doesn`t offer the
getTotalSize() method.

4)      When should we completely switch to SQL2 syntax with our
queries? I saw that XPath is deprecated but still highly used in
Jackrabbit.

5)      If I have multiple workspaces within my repository they are
sharing all the same VersionStorage. How do I know to which workspace a
specific version in the version history belongs to? Can I query the
VersionStorage for versions contained in a particular workspace?

a.       If I cannot differentiate the data in the VersionStorage, why
is there one global VersionStorage for all workspaces instead of a
VersionStorage per workspace?

6)      If I am using different datasources for version storage and
workspaces, all connected to different database schemas in the same
database, how is transaction safety guaranteed? Only through XA
transactions?

 

 

Thanks for your support!

 

BR,

 

Sascha


Re: Several questions regarding the JCR API and Jackrabbit

Posted by Lukas Kahwe Smith <ml...@pooteeweet.org>.
On Apr 3, 2012, at 10:20 , <Sa...@bosch-si.com> <Sa...@bosch-si.com> wrote:

> Hi all,
> 
> 
> 
> I have a few questions about the JCR API and the internals of Jackrabbit
> and I didn`t find an answer neither in the specification nor in the
> Jackrabbit wiki:
> 
> 
> 
> 1)      How do I query for nodes with distinct property values? Imagine
> I have couple of nodes with the same property value and I want to query
> only for the distinct property values.

afaik there is no such feature in Jackrabbit.
modeshape has added this to their implemementation:
http://docs.jboss.org/modeshape/latest/manuals/reference/html/jcr-query-and-search.html#jcr-sql-query-language

more generally i would love to see facetting support (not only for distinct, but also to get COUNT), which to some level the HippoCMS guys have implemented in their fork, which afaik is based on 2.2

regards,
Lukas Kahwe Smith
mls@pooteeweet.org