jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Noel-Storr <luke.noel-st...@integrate.co.uk>
Subject Re: JQOM: How to find nodes where a specific property does NOT exist
Date Fri, 07 Jun 2013 07:50:21 GMT
Hi,

Would QueryObjectModelFactory.not() do the trick?

constraint = qomf.and(
    constraint,
    qomf.not(qomf.propertyExistence(nodeTypeSelector.getSelectorName(), "my:ownDate")));


Regards,

Luke Noel-Storr.
----------------

Integrated Publishing Solutions Ltd.
Tel: +44 (0)1926 889199
http://www.integrate.co.uk



On 7 Jun 2013, at 08:36, Ulrich <Forums@gombers.de> wrote:

> With JQOM I need to search for nt:file-nodes where a self-defined mixin-property
> is NOT set. With QueryObjectModelFactory.propertyExistence() I can test for
> existence but do I do the negotiation.
> My sample is:
>                valueFactory = session.getValueFactory();
>                queryManager = session.getWorkspace().getQueryManager();
>                qomf = queryManager.getQOMFactory();
>                nodeTypeSelector = qomf.selector("nt:file", selectorName);
> 
>               constraint=qomf.descendantNode(nodeTypeSelector.getSelectorName(),
> subtreeQuery);
>                constraint  = qomf.and(constraint,
> qomf.propertyExistence(nodeTypeSelector.getSelectorName(), "my:ownDate"));
>                QueryObjectModel qom = qomf.createQuery(nodeTypeSelector,
> constraint, null, null);
>                QueryResult queryResult = qom.execute();
>                nodeIterator = queryResult.getNodes();
> 
> There is a negotiation mentioned for SQL2 in chapter 6.7.18 of the
> JCR-Specification but I have no clue how to adapt this for JQOM.
> 
> Thanks in advance,
> Ulrich


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message