jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sucena <msuc...@maned.com>
Subject RE: JCR UnsupportedRepositoryOperationException when a query constraint has "NOT"
Date Tue, 15 Jan 2013 17:06:10 GMT
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
msucena@maned.com 

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:msucena@maned.com] 
Sent: Thursday, January 03, 2013 1:41 PM
To: users@jackrabbit.apache.org
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
msucena@maned.com<mailto:msucena@maned.com>

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


Mime
View raw message