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


Java Core.retrieveXPathQueryAggregate方法代码示例

本文整理汇总了Java中com.mendix.core.Core.retrieveXPathQueryAggregate方法的典型用法代码示例。如果您正苦于以下问题:Java Core.retrieveXPathQueryAggregate方法的具体用法?Java Core.retrieveXPathQueryAggregate怎么用?Java Core.retrieveXPathQueryAggregate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mendix.core.Core的用法示例。


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

示例1: executeInBatches

import com.mendix.core.Core; //导入方法依赖的package包/类
public static Boolean executeInBatches(String xpathRaw, BatchState batchState, int batchsize, boolean waitUntilFinished, boolean asc) throws CoreException, InterruptedException
{
	String xpath = xpathRaw.startsWith("//") ? xpathRaw : "//" + xpathRaw;
	
	long count = Core.retrieveXPathQueryAggregate(Core.createSystemContext(), "count(" + xpath + ")");
	int loop = (int) Math.ceil(((float)count) / ((float)batchsize));
	
	
	Core.getLogger("communitycommons").info(
			"[ExecuteInBatches] Starting batch on ~ " + count + " objects divided over ~ " + loop + " batches. "
			+ (waitUntilFinished ? "Waiting until the batch has finished..." : "")
	);
	
	executeInBatchesHelper(xpath, batchsize, 0, batchState, count, asc);
	
	if (waitUntilFinished) {
		while (batchState.getState() == 0) {
			Thread.sleep(5000);
		}
		if (batchState.getState() == 1) { 
			Core.getLogger("communitycommons").debug("[ExecuteInBatches] Successfully finished batch");
			return true;
		}
		Core.getLogger("communitycommons").error("[ExecuteInBatches] Failed to finish batch. Please check the application log for more details.");
		return false;
	}
	
	return true;
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:30,代码来源:Misc.java

示例2: count

import com.mendix.core.Core; //导入方法依赖的package包/类
public long count( ) throws CoreException {
	assertEmptyStack();

	return Core.retrieveXPathQueryAggregate(context, "count(" + getXPath() +")");
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:6,代码来源:XPath.java


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