本文整理汇总了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;
}
示例2: count
import com.mendix.core.Core; //导入方法依赖的package包/类
public long count( ) throws CoreException {
assertEmptyStack();
return Core.retrieveXPathQueryAggregate(context, "count(" + getXPath() +")");
}