jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sucena <msuc...@maned.com>
Subject JCR UnsupportedRepositoryOperationException when a query constraint has "NOT"
Date Thu, 03 Jan 2013 18:40:47 GMT
Hello fellow Jackrabbit(JCR) Users:

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

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,


        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.

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

Have you seen Nervous Pixel, MEI's creative services division?

MEI Releases InPorter 3 to Support Cross-Media Publishing

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