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?

Regards,
Ulrich

Reply via email to