You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Michael Coldewey <po...@coldy.de> on 2010/07/28 21:45:55 UTC
One Question about SQL2
Hello,
sorry, I know, ist the wrong mailinglist, but i am actually not member of
the users list.
Perhaps someone would and could answer me.
Till now I use XPATH for querying the repository, but now I want to change
to SQL2. The samples in the test case explains the basics, but I didnt
found, how to make a query to find nodes, which have childs with specific
properties.
[my:a]
[my:b]
Prop1='test'
I want every node [my:a] which have any child with the property ,Prop1' and
value ,test'.
In xpath, this is really simple to solve, but i dont know to make it in
SQL2.
It would be great, if someone give me a hint on this.
Thanks a lot
BR,
Michael Coldewey
AW: One Question about SQL2
Posted by Michael Coldewey <po...@coldy.de>.
I wanted to try sql2 because XPATH and SQL are marked as deprecated in jcr
2.0
After trying SQL2, I still will use XPATH for a while for this kind of
query...
BR,
Michael Coldewey
-----Ursprüngliche Nachricht-----
Von: Marcel Reutegger [mailto:marcel.reutegger@day.com]
Gesendet: Freitag, 30. Juli 2010 14:25
An: dev
Betreff: Re: One Question about SQL2
hi,
On Thu, Jul 29, 2010 at 13:22, Michael Coldewey <po...@coldy.de> wrote:
> Thank you a lot...
>
> I will try it, but it seems not so simple as with xpath-query.
why don't you use xpath then?
regards
marcel
> BR
> Michael Coldewey
>
> -----Ursprüngliche Nachricht-----
> Von: Alexander Klimetschek [mailto:aklimets@day.com]
> Gesendet: Donnerstag, 29. Juli 2010 11:05
> An: dev@jackrabbit.apache.org
> Betreff: Re: One Question about SQL2
>
> I think something like this could work (beware, untested):
>
> SELECT * FROM [my:a] AS p INNER JOIN child AS c ON ISDESCENDANTNODE(p,
> c) WHERE c.[jcr:primaryType] = 'my:b' AND c.Prop1 = 'test'
>
> Regards,
> Alex
>
> On Wed, Jul 28, 2010 at 21:45, Michael Coldewey <po...@coldy.de> wrote:
>> Hello,
>>
>>
>>
>> sorry, I know, ist the wrong mailinglist, but i am actually not member of
>> the users list.
>>
>>
>>
>> Perhaps someone would and could answer me.
>>
>>
>>
>> Till now I use XPATH for querying the repository, but now I want to
change
>> to SQL2. The samples in the test case explains the basics, but I didnt
>> found, how to make a query to find nodes, which have childs with specific
>> properties.
>>
>>
>>
>> [my:a]
>>
>> [my:b]
>>
>> Prop1=test
>>
>>
>>
>>
>>
>> I want every node [my:a] which have any child with the property Prop1
> and
>> value test.
>>
>>
>>
>> In xpath, this is really simple to solve, but i dont know to make it in
>> SQL2.
>>
>>
>>
>> It would be great, if someone give me a hint on this.
>>
>>
>>
>> Thanks a lot
>>
>> BR,
>>
>> Michael Coldewey
>>
>>
>>
>>
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
>
>
Re: One Question about SQL2
Posted by Marcel Reutegger <ma...@day.com>.
hi,
On Thu, Jul 29, 2010 at 13:22, Michael Coldewey <po...@coldy.de> wrote:
> Thank you a lot...
>
> I will try it, but it seems not so simple as with xpath-query.
why don't you use xpath then?
regards
marcel
> BR
> Michael Coldewey
>
> -----Ursprüngliche Nachricht-----
> Von: Alexander Klimetschek [mailto:aklimets@day.com]
> Gesendet: Donnerstag, 29. Juli 2010 11:05
> An: dev@jackrabbit.apache.org
> Betreff: Re: One Question about SQL2
>
> I think something like this could work (beware, untested):
>
> SELECT * FROM [my:a] AS p INNER JOIN child AS c ON ISDESCENDANTNODE(p,
> c) WHERE c.[jcr:primaryType] = 'my:b' AND c.Prop1 = 'test'
>
> Regards,
> Alex
>
> On Wed, Jul 28, 2010 at 21:45, Michael Coldewey <po...@coldy.de> wrote:
>> Hello,
>>
>>
>>
>> sorry, I know, ist the wrong mailinglist, but i am actually not member of
>> the users list.
>>
>>
>>
>> Perhaps someone would and could answer me.
>>
>>
>>
>> Till now I use XPATH for querying the repository, but now I want to change
>> to SQL2. The samples in the test case explains the basics, but I didnt
>> found, how to make a query to find nodes, which have childs with specific
>> properties.
>>
>>
>>
>> [my:a]
>>
>> [my:b]
>>
>> Prop1=‘test‘
>>
>>
>>
>>
>>
>> I want every node [my:a] which have any child with the property ‚Prop1‘
> and
>> value ‚test‘.
>>
>>
>>
>> In xpath, this is really simple to solve, but i dont know to make it in
>> SQL2.
>>
>>
>>
>> It would be great, if someone give me a hint on this.
>>
>>
>>
>> Thanks a lot
>>
>> BR,
>>
>> Michael Coldewey
>>
>>
>>
>>
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
>
>
AW: One Question about SQL2
Posted by Michael Coldewey <po...@coldy.de>.
Thank you a lot...
I will try it, but it seems not so simple as with xpath-query.
BR
Michael Coldewey
-----Ursprüngliche Nachricht-----
Von: Alexander Klimetschek [mailto:aklimets@day.com]
Gesendet: Donnerstag, 29. Juli 2010 11:05
An: dev@jackrabbit.apache.org
Betreff: Re: One Question about SQL2
I think something like this could work (beware, untested):
SELECT * FROM [my:a] AS p INNER JOIN child AS c ON ISDESCENDANTNODE(p,
c) WHERE c.[jcr:primaryType] = 'my:b' AND c.Prop1 = 'test'
Regards,
Alex
On Wed, Jul 28, 2010 at 21:45, Michael Coldewey <po...@coldy.de> wrote:
> Hello,
>
>
>
> sorry, I know, ist the wrong mailinglist, but i am actually not member of
> the users list.
>
>
>
> Perhaps someone would and could answer me.
>
>
>
> Till now I use XPATH for querying the repository, but now I want to change
> to SQL2. The samples in the test case explains the basics, but I didnt
> found, how to make a query to find nodes, which have childs with specific
> properties.
>
>
>
> [my:a]
>
> [my:b]
>
> Prop1=test
>
>
>
>
>
> I want every node [my:a] which have any child with the property Prop1
and
> value test.
>
>
>
> In xpath, this is really simple to solve, but i dont know to make it in
> SQL2.
>
>
>
> It would be great, if someone give me a hint on this.
>
>
>
> Thanks a lot
>
> BR,
>
> Michael Coldewey
>
>
>
>
--
Alexander Klimetschek
alexander.klimetschek@day.com
Re: One Question about SQL2
Posted by Alexander Klimetschek <ak...@day.com>.
I think something like this could work (beware, untested):
SELECT * FROM [my:a] AS p INNER JOIN child AS c ON ISDESCENDANTNODE(p,
c) WHERE c.[jcr:primaryType] = 'my:b' AND c.Prop1 = 'test'
Regards,
Alex
On Wed, Jul 28, 2010 at 21:45, Michael Coldewey <po...@coldy.de> wrote:
> Hello,
>
>
>
> sorry, I know, ist the wrong mailinglist, but i am actually not member of
> the users list.
>
>
>
> Perhaps someone would and could answer me.
>
>
>
> Till now I use XPATH for querying the repository, but now I want to change
> to SQL2. The samples in the test case explains the basics, but I didnt
> found, how to make a query to find nodes, which have childs with specific
> properties.
>
>
>
> [my:a]
>
> [my:b]
>
> Prop1=‘test‘
>
>
>
>
>
> I want every node [my:a] which have any child with the property ‚Prop1‘ and
> value ‚test‘.
>
>
>
> In xpath, this is really simple to solve, but i dont know to make it in
> SQL2.
>
>
>
> It would be great, if someone give me a hint on this.
>
>
>
> Thanks a lot
>
> BR,
>
> Michael Coldewey
>
>
>
>
--
Alexander Klimetschek
alexander.klimetschek@day.com