cancel
Showing results for 
Search instead for 
Did you mean: 

parameterized NXQL queries

nuxeonovice_
Champ in-the-making
Champ in-the-making

We have nuxeo queries which come from a constants file. A sample query is listed below.

public static final String GET_FILES_BY_PARENT ="SELECT * FROM File WHERE ecm:parentId = ?"

OR

public static final String GET_FILES_BY_PARENT ="SELECT * FROM File WHERE ecm:parentId = :parentID"

How can I plugin in the parameters while excuting the query. We execute the query in the following manner.

Documents docs = (Documents) session.newRequest("Document.Query").set("query", GET_FILES_BY_PARENT).execute();

We can have more than one parameter in a query. How can we parameterize the query without ugly string manipulations.

Thanks

1 REPLY 1

Florent_Guillau
World-Class Innovator
World-Class Innovator

It seems you're using Nuxeo Client and not coding server-side code.

I'm not aware of any helper to build parametrized queries for Nuxeo Client. On the server side there's NXQLQueryBuilder.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.