How to implement complex query in X-application

I find the following code in document

QueryContainer query = new QueryContainer(“Property”);
query.add(new QueryElement(“/Property/@Category”, “Buy”, “=”));
Cursor docCursor = ws.query(“buyProperties”, query);
while (docCursor.hasNext()) {
BusinessDocument doc = (BusinessDocument)docCursor.next();
}

However, if I want to make complex query say,
/Property/[@Category=‘abc’ or @Category~=‘xxx’]

How to make it?

Thanks.

Hello

Hello,

with XApplication 3.1.3 we added the method query to the BusinessDocumentWorkspace which accepts a simple XQL query string and returns a BusinessDocumentCursor. Therefore, it is not longer required to create a QueryContainer.

For more details have a look into the JavaDocs of the class BusinessDocumentWorkspace.

Bye,
Christian.

Can you give me some example on this?

Thanks.

Hi,

referring to your first post, your example would look like this:

String arbitraryQuery="/Property[./@Category='abc' or ./@Category~='xxx']";
String DOCTYPE = "Property";
Cursor docCursor = ws.query("buyProperties", DOCTYPE, arbitraryQuery);
while (docCursor.hasNext()) {
BusinessDocument doc = (BusinessDocument)docCursor.next();
}



Hope this helps

Bye
Thorsten