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 Wed, 13 Apr 2005 10:17:43 GMT
On 4/13/05, Marcel Reutegger <marcel.reutegger@gmx.net> wrote:
> hmm, interesting thought... and I think you're right. I guess that needs
> some clarification in the spec. it currently states that element node
> test and jcr:primaryType restrict nodes to the common type.
> 
> shouldn't the SQL equivalent be:
> 
> SELECT * FROM nt:base WHERE jcr:primaryType='X'
> and
> SELECT * FROM X

Yeah, sorry, that's right, I got mixed up.

Except, shouldn't
  
//*[jcr:primaryType='X']

return a table with 
1) A node iterator with every node of *declared* type X
2) A table with:
  a) a row for each node of *declared* type X (that is, same as the iterator)
  b) a column for each property *declared or inherited* in type X plus
     the special pseudo-property column jcr:path.

If that is true then 

SELECT * FROM nt:base WHERE jcr:primaryType='X'

is not the equivalent, because it would produce a table with 
columns only for the properties declared in nt:base (jcr:primaryType,
jcr:mixinTypes) plus jcr:path.

so the correct SQL equivalent would be

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

Or maybe I am confused again :-)
...Marcel?

> 
> ?
> 
> regards
>   marcel
> 
> Peeter Piegaze wrote:
> > 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:
> >

Mime
View raw message