jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peeter Piegaze <peeter.pieg...@gmail.com>
Subject Re: Querying the jcr:primaryType property [2]
Date Tue, 12 Apr 2005 15:27:25 GMT
Well, actually this is how it was implemented and at the time 
we thought it made sense (or maybe we didn't think about it 
too much ;-). 

Now that I look at it again it does strike me as incorrect.

IMO the correct behavior should be:

//*[jcr:primaryType='X'] return all nodes with *declared* type of X.
//element(*,'X') returns all nodes of type X (declared and inherited)

The equivalents in SQL would be (respectively):

SELECT * FROM jcr:primaryType WHERE jcr:primaryType='X'
and
SELECT * FROM jcr:primaryType


 




On Apr 12, 2005 5:13 PM, Tobias Strasser <tobias.strasser@gmail.com> wrote:
> yes. this is normal.
> 
> On Apr 12, 2005 5:10 PM, Bertrand LEGA <legabertrand@yahoo.fr> wrote:
> > My message didn't render properly.
> > Here is the body of the message.
> >
> > Hello,
> >
> > I'm just wondering whether it is normla that querying the
> > jcr:primaryType takes into account the content type inheritance.
> > I have the following content type definition :
> >
> > nt:base
> >    |
> >    -- typeA
> >          |
> >          -- typeB
> >
> > And then, I created three nodes
> >    testA1    of type    typeA
> >    testA2    of type    typeA
> >    testB1    of type    typeB
> >
> > The following query //*[@jcr:primaryType='typeA'] returns testA1, testA2
> > and testB1.
> > Of course the query //*[@jcr:primaryType='typeB'] returns only testB1.
> >
> > Is this supposed to be normal ?
> >
> > Regards,
> > Bertrand.
> >
> >
> 
> --
> ------------------------------------------< tobias.strasser@day.com >---
> Tobias Strasser, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>

Mime
View raw message