我正在使用IntegrationRepositoryView的Integration仓库框架,并覆盖了executeUncachedQuery函数。 每次调用该方法时都要获取一个动态查询。 例如(ean EQUALS 5052931399536)或 ((ean == 5052931399536)和(siteIds包括diyStore)) 我必须为不同的pInput处理方法中的ean值。我们应该如何实现这一目标。
我执行以下操作:
public RepositoryItem[] executeQueryCommand(final Object pInput) throws RepositoryException {
final String perfName = "executeQueryCommand";
PerformanceMonitor.startOperation("IntegrationRepositoryView", perfName);
boolean perfCancelled = false;
try {
final IntegrationRepositoryItemDescriptor desc = (IntegrationRepositoryItemDescriptor)getItemDescriptor();
final IntegrationRepositoryCommandDescriptor queryCommandDesc = desc.getQueryCommand();
if(queryCommandDesc == null) {
perfCancelled = true;
throw new RepositoryException(IntegrationRepositoryConstants.NULL_QUERY_COMMAND);
}
final Command queryCommand = queryCommandDesc.getCommand();
if(queryCommand == null) {
perfCancelled = true;
throw new RepositoryException(IntegrationRepositoryConstants.NULL_QUERY_COMMAND);
}
final CommandResult result = queryCommand.execute(pInput);
return processResults(queryCommand, result);
} catch(final CommandInvocationException cie) {
perfCancelled = true;
throw new RepositoryException(cie);
}
}