jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich <For...@gombers.de>
Subject How to setup JQOM-Query testing String-Array
Date Thu, 16 May 2013 08:31:48 GMT
The list of the supplied comparison-operator does not offer a "contains"-method (see JCR 2.0
specs chapter 6.7.17). How would I check for the occurrence of a specific String.

For a String-value I do it this way:

            valueFactory = session.getValueFactory();
            queryManager = session.getWorkspace().getQueryManager();
            qomf = queryManager.getQOMFactory();
            nodeTypeSelector = qomf.selector(nodeTypeName, selectorName);
            operator            = qomf.JCR_OPERATOR_EQUAL_TO;
            dynOperand  = qomf.propertyValue(selectorName, userProperty);

            StaticOperand statOperand  = qomf.literal(valueFactory.createValue(principal));
            Comparison compare    = qomf.comparison(dynOperand , operator, statOperand);
            constraint= compare;

But, again, what can I do about Arrays?


View raw message