jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jc <jcha...@maned.com>
Subject JCR UnsupportedRepositoryOperationException when a query constraint has "NOT"
Date Thu, 27 Dec 2012 22:33:01 GMT
I am building a query constraint for fetching all the nodes whose names does
not contain a string.

So the way I have approached to build the constraint was as below:

       QueryObjectModelFactory factory =
        ValueFactory valueFactory = session.getValueFactory();
        DynamicOperand operand =
        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,

This throws the "UnsupportedRepositoryOperationException". Any thoughts

View this message in context: http://jackrabbit.510166.n4.nabble.com/JCR-UnsupportedRepositoryOperationException-when-a-query-constraint-has-NOT-tp4657295.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message