当前位置: 首页>>代码示例>>Java>>正文


Java XName类代码示例

本文整理汇总了Java中com.marklogic.xcc.types.XName的典型用法代码示例。如果您正苦于以下问题:Java XName类的具体用法?Java XName怎么用?Java XName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XName类属于com.marklogic.xcc.types包,在下文中一共展示了XName类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import com.marklogic.xcc.types.XName; //导入依赖的package包/类
@Override
public void write(KEYOUT key, VALUEOUT value) throws IOException,
        InterruptedException {
    Session session = getSession();
    try {
        AdhocQuery request = session.newAdhocQuery(statement);
        if (queryLanguage != null) {
        	RequestOptions options = new RequestOptions();
        	options.setQueryLanguage(queryLanguage);
            request.setOptions(options);
        }
        request.setNewVariable(new XName(MR_NAMESPACE, OUTPUT_KEY_VARNAME),   
                InternalUtilities.newValue(keyType, key));
        request.setNewVariable(new XName(MR_NAMESPACE, OUTPUT_VALUE_VARNAME), 
                InternalUtilities.newValue(valueType, value));
     
        session.submitRequest(request);
        commitIfNecessary();
    } catch (RequestException e) {    
        LOG.error(e);
        LOG.error(statement);
        throw new IOException(e);
    }     
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:KeyValueWriter.java

示例2: bindParams

import com.marklogic.xcc.types.XName; //导入依赖的package包/类
private void bindParams(Map<String, Parameter> params, Request request) { //throws RequestException {
    for (Map.Entry<String, Parameter> e: params.entrySet()) {
		XName name = new XName(e.getKey());
    	XdmValue value;
    	switch (e.getValue().getType()) {
    		case "boolean": {
    			value = ValueFactory.newXSBoolean(new Boolean(e.getValue().getName()));
    			break;
    		}
    		case "byte": 
    		case "int": 
    		case "long": 
    		case "short": {
    			value = ValueFactory.newXSInteger(new Integer(e.getValue().getName()));
    			break;
    		}
    		case "double": {
    			value = ValueFactory.newValue(ValueType.XS_DOUBLE, new Double(e.getValue().getName()));
    			break;
    		}
    		case "float": {
    			value = ValueFactory.newValue(ValueType.XS_FLOAT, new Float(e.getValue().getName()));
    			break;
    		}
    		default: 
    			value = ValueFactory.newXSString(e.getValue().getName());
    	}
		request.setVariable(ValueFactory.newVariable(name, value));
    }
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:31,代码来源:MarkLogicXCCPlugin.java

示例3: TransformWriter

import com.marklogic.xcc.types.XName; //导入依赖的package包/类
public TransformWriter(Configuration conf,
    Map<String, ContentSource> hostSourceMap, boolean fastLoad,
    AssignmentManager am) {
    super(conf, hostSourceMap, fastLoad, am);

    batchSize = effectiveVersion >= BATCH_MIN_VERSION ? batchSize : 1;
    moduleUri = conf.get(ConfigConstants.CONF_TRANSFORM_MODULE);
    functionNs = conf.get(ConfigConstants.CONF_TRANSFORM_NAMESPACE, "");
    functionName = conf.get(ConfigConstants.CONF_TRANSFORM_FUNCTION,
        "transform");
    functionParam = conf.get(ConfigConstants.CONF_TRANSFORM_PARAM, "");
    String contentTypeStr = conf.get(MarkLogicConstants.CONTENT_TYPE,
        MarkLogicConstants.DEFAULT_CONTENT_TYPE);
    contentType = ContentType.valueOf(contentTypeStr);
    queries = new AdhocQuery[sessions.length];
    
    pendingURIs = new HashSet[sessions.length];
    for (int i = 0; i < sessions.length; i++) {
        pendingURIs[i] = new HashSet<DocumentURI>(batchSize);
    }
    // counts is only initialized by ContentWriter when batchSize > 1
    if (counts == null) {
        counts = new int[sessions.length];
    }
    // Whether the server mlcp talks to has a transformation-option
    // in transformation-insert-batch signature
    boolean hasOpt = effectiveVersion >= TRANS_OPT_MIN_VERSION;
    uris = new XdmValue[counts.length][batchSize];
    values = new XdmValue[counts.length][batchSize];
    optionsVals = new XdmValue[counts.length][batchSize];
    optionsMap = new HashMap<String, String>();
    uriName = new XName("URI");
    contentName = new XName("CONTENT");
    optionsName = new XName("INSERT-OPTIONS");
    query = constructQryString(moduleUri, functionNs,
            functionName, functionParam, effectiveVersion, hasOpt);
    if (hasOpt) {
        transOptName = new XName("TRANSFORM-OPTION");
        transOpt = constructTransformOption(conf,
                functionParam, functionNs);
    }
    if (LOG.isDebugEnabled()) {
        LOG.debug("query:"+query);
    }
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:46,代码来源:TransformWriter.java

示例4: getName

import com.marklogic.xcc.types.XName; //导入依赖的package包/类
private XName getName(String name, String namespace) {
    return new XName(namespace, name);
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:4,代码来源:MarklogicRunnerApp.java


注:本文中的com.marklogic.xcc.types.XName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。