Search in sources :

Example 1 with QueryOptionsManager

use of com.marklogic.client.admin.QueryOptionsManager in project components by Talend.

the class MarkLogicCriteriaReader method prepareQueryOption.

private void prepareQueryOption() {
    QueryOptionsManager qryOptMgr = connectionClient.newServerConfigManager().newQueryOptionsManager();
    if (StringUtils.isNotEmpty(settings.queryOptionLiterals)) {
        StringHandle strHandle = new StringHandle();
        switch(settings.queryLiteralType) {
            case "JSON":
                {
                    strHandle.withFormat(Format.JSON);
                    break;
                }
            case "XML":
                {
                    strHandle.withFormat(Format.XML);
                    break;
                }
        }
        strHandle.set(settings.queryOptionLiterals);
        qryOptMgr.writeOptions(settings.queryOptionName, strHandle);
    }
}
Also used : StringHandle(com.marklogic.client.io.StringHandle) QueryOptionsManager(com.marklogic.client.admin.QueryOptionsManager)

Aggregations

QueryOptionsManager (com.marklogic.client.admin.QueryOptionsManager)1 StringHandle (com.marklogic.client.io.StringHandle)1