I am surprised that no one else is reporting this type of issue.  If not using 
QOM for querying what is everyone using:  JCR-SQL2, XPath, or something else.  
Any information anyone can provide about how to get "NOT" queries working would 
be greatly appreciated.  Thank you for your continued assistance.

Sincerely,
Michael P. Sucena
MEI Software Engineer 
610 Old York Rd.
Suite:  250
Jenkintown, PA  19046
Phone:  215-886-5662 x281
Fax:  215-886-5681
[email protected] 

Have you seen Nervous Pixel, MEI's creative services division?
www.nervouspixel.com

MEI Releases InPorter 3 to Support Cross-Media Publishing
http://www.maned.com/news/pressreleases/051911

-----Original Message-----
From: Michael Sucena [mailto:[email protected]] 
Sent: Thursday, January 03, 2013 1:41 PM
To: [email protected]
Cc: Jasmine Chacko; Morrell Jacobs
Subject: JCR UnsupportedRepositoryOperationException when a query constraint 
has "NOT" 

Hello fellow Jackrabbit(JCR) Users:

I am building a query constraint for fetching all the nodes whose names does 
not contain a string.

So the way I have approached building the constraint was as below:

       QueryObjectModelFactory factory = 
session.getWorkspace().getQueryManager().getQOMFactory();
        ValueFactory valueFactory = session.getValueFactory();

        DynamicOperand operand = 
factory.lowerCase(factory.nodeName(DEFAULT_SELECTOR_NAME));

        Literal literal;
        Constraint constraint;
--------------------
--------------------

 literal = factory.literal(valueFactory.createValue("%" + "searchVal" + "%")); 
constraint = factory.not(factory.comparison(operand, 
QueryObjectModelConstants.JCR_OPERATOR_LIKE, literal));

------------------
-----------------


        QueryObjectModelFactory factory = queryManager.getQOMFactory();

        Selector source = factory.selector(nodeType, selectorName);
        Column[] columns = null;

        return factory.createQuery(source, constraint, orderings, 
columns).execute().getNodes();

This throws the "UnsupportedRepositoryOperationException". Any thoughts please? 
 Thank you.

Sincerely,
Michael P. Sucena
MEI Software Engineer
610 Old York Rd.
Suite:  250
Jenkintown, PA  19046
Phone:  215-886-5662 x281
Fax:  215-886-5681
[email protected]<mailto:[email protected]>

Have you seen Nervous Pixel, MEI's creative services division?
www.nervouspixel.com<http://www.nervouspixel.com/>

MEI Releases InPorter 3 to Support Cross-Media Publishing
http://www.maned.com/news/pressreleases/051911

Reply via email to