You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Robert A. Decker" <de...@robdecker.com> on 2012/06/30 22:33:59 UTC

query factory - boolean

Somehow it seems like I shouldn't have so much trouble with this…

I have a property on a node that is type Boolean.

How do I query for nodes where it's true?


Something like, when adding to my constraints:

constraint = qf.and(constraint, qf.comparison(SELECTOR_NAME, "isMoodAnnotated",QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, false);


(obviously this code doesn't work)


Rob

Re: query factory - boolean

Posted by sam ” <sk...@gmail.com>.
Yes, it is deprecated. But, I use it  :P


On Sat, Jun 30, 2012 at 6:01 PM, Robert A. Decker <de...@robdecker.com>wrote:

> Isn't xpath deprecated?
>
> Rob
>
> On Jun 30, 2012, at 11:43 PM, sam ” wrote:
>
> > maybe use xpath?
> > //*[@isMoodAnnotated = true]
> >
> >
> > On Sat, Jun 30, 2012 at 4:48 PM, Robert A. Decker <decker@robdecker.com
> >wrote:
> >
> >> Sorry, in my previous email,
> >>
> >> qf is type QueryObjectModelFactory
> >>
> >> constraint is the constraint that I'm building.
> >>
> >>
> >> Rob
> >>
> >> On Jun 30, 2012, at 10:33 PM, Robert A. Decker wrote:
> >>
> >>> Somehow it seems like I shouldn't have so much trouble with this…
> >>>
> >>> I have a property on a node that is type Boolean.
> >>>
> >>> How do I query for nodes where it's true?
> >>>
> >>>
> >>> Something like, when adding to my constraints:
> >>>
> >>> constraint = qf.and(constraint, qf.comparison(SELECTOR_NAME,
> >> "isMoodAnnotated",QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, false);
> >>>
> >>>
> >>> (obviously this code doesn't work)
> >>>
> >>>
> >>> Rob
> >>
> >>
>
>

Re: query factory - boolean

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Sun, Jul 1, 2012 at 12:01 AM, Robert A. Decker <de...@robdecker.com> wrote:
> Isn't xpath deprecated?

It is deprecated in the latest JCR spec, but still fully supported by
the Jackrabbit repository that Sling uses.

See discussion at http://markmail.org/thread/ill2ufoqokivr2c5

-Bertrand

Re: query factory - boolean

Posted by "Robert A. Decker" <de...@robdecker.com>.
Isn't xpath deprecated?

Rob

On Jun 30, 2012, at 11:43 PM, sam ” wrote:

> maybe use xpath?
> //*[@isMoodAnnotated = true]
> 
> 
> On Sat, Jun 30, 2012 at 4:48 PM, Robert A. Decker <de...@robdecker.com>wrote:
> 
>> Sorry, in my previous email,
>> 
>> qf is type QueryObjectModelFactory
>> 
>> constraint is the constraint that I'm building.
>> 
>> 
>> Rob
>> 
>> On Jun 30, 2012, at 10:33 PM, Robert A. Decker wrote:
>> 
>>> Somehow it seems like I shouldn't have so much trouble with this…
>>> 
>>> I have a property on a node that is type Boolean.
>>> 
>>> How do I query for nodes where it's true?
>>> 
>>> 
>>> Something like, when adding to my constraints:
>>> 
>>> constraint = qf.and(constraint, qf.comparison(SELECTOR_NAME,
>> "isMoodAnnotated",QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, false);
>>> 
>>> 
>>> (obviously this code doesn't work)
>>> 
>>> 
>>> Rob
>> 
>> 


Re: query factory - boolean

Posted by sam ” <sk...@gmail.com>.
maybe use xpath?
//*[@isMoodAnnotated = true]


On Sat, Jun 30, 2012 at 4:48 PM, Robert A. Decker <de...@robdecker.com>wrote:

> Sorry, in my previous email,
>
> qf is type QueryObjectModelFactory
>
> constraint is the constraint that I'm building.
>
>
> Rob
>
> On Jun 30, 2012, at 10:33 PM, Robert A. Decker wrote:
>
> > Somehow it seems like I shouldn't have so much trouble with this…
> >
> > I have a property on a node that is type Boolean.
> >
> > How do I query for nodes where it's true?
> >
> >
> > Something like, when adding to my constraints:
> >
> > constraint = qf.and(constraint, qf.comparison(SELECTOR_NAME,
> "isMoodAnnotated",QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, false);
> >
> >
> > (obviously this code doesn't work)
> >
> >
> > Rob
>
>

Re: query factory - boolean

Posted by "Robert A. Decker" <de...@robdecker.com>.
Sorry, in my previous email,

qf is type QueryObjectModelFactory

constraint is the constraint that I'm building.


Rob

On Jun 30, 2012, at 10:33 PM, Robert A. Decker wrote:

> Somehow it seems like I shouldn't have so much trouble with this…
> 
> I have a property on a node that is type Boolean.
> 
> How do I query for nodes where it's true?
> 
> 
> Something like, when adding to my constraints:
> 
> constraint = qf.and(constraint, qf.comparison(SELECTOR_NAME, "isMoodAnnotated",QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, false);
> 
> 
> (obviously this code doesn't work)
> 
> 
> Rob