jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Seidel. Robert" <Robert.Sei...@aeb.de>
Subject AW: How to setup JQOM-Query testing String-Array
Date Thu, 16 May 2013 08:49:16 GMT

If you use a multi value string property, you can query for one of the strings like you did
below. If you store an array inside a binary property, then it will be not queryable.

If you want to query for an expression inside a string, you can use the "LIKE" operator and

Regards, Robert

-----Urspr√ľngliche Nachricht-----
Von: Ulrich [mailto:Forums@gombers.de]
Gesendet: Donnerstag, 16. Mai 2013 10:32
An: jackrabbit Mailing-List
Betreff: How to setup JQOM-Query testing String-Array

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?



AEB treffen Sie im Juni auf diesen Veranstaltungen:
transport logistic | 4.-7. Juni 2013 | M√ľnchen
EXCHAiNGE | 18.-19. Juni 2013 | Frankfurt am Main
Weitere Informationen und Terminreservierung unter: www.aeb.de/events<http://logi4.xiti.com/gopc.url?xts=487638&xtor=AD-5-[aeb%20mails]-[link%20in%20mailsignatur]-[intext]-[e-mail-signatur]-[0]-[]&url=http://www.aeb.de/de/events/index.php>

View raw message