本文整理汇总了Java中org.alfresco.service.cmr.search.SearchParameters.getLimitBy方法的典型用法代码示例。如果您正苦于以下问题:Java SearchParameters.getLimitBy方法的具体用法?Java SearchParameters.getLimitBy怎么用?Java SearchParameters.getLimitBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.search.SearchParameters
的用法示例。
在下文中一共展示了SearchParameters.getLimitBy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DBResultSet
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
public DBResultSet(SearchParameters searchParameters, List<Long> dbids, NodeDAO nodeDao, NodeService nodeService, TenantService tenantService, int maximumResultsFromUnlimitedQuery)
{
this.nodeDao = nodeDao;
this.dbids = dbids;
this.nodeService = nodeService;
this.tenantService = tenantService;
this.prefetch = new BitSet(dbids.size());
nodeRefs= new NodeRef[(dbids.size())];
final LimitBy limitBy;
int maxResults = -1;
if (searchParameters.getMaxItems() >= 0)
{
maxResults = searchParameters.getMaxItems();
limitBy = LimitBy.FINAL_SIZE;
}
else if(searchParameters.getLimitBy() == LimitBy.FINAL_SIZE && searchParameters.getLimit() >= 0)
{
maxResults = searchParameters.getLimit();
limitBy = LimitBy.FINAL_SIZE;
}
else
{
maxResults = searchParameters.getMaxPermissionChecks();
if (maxResults < 0)
{
maxResults = maximumResultsFromUnlimitedQuery;
}
limitBy = LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS;
}
this.resultSetMetaData = new SimpleResultSetMetaData(
maxResults > 0 && dbids.size() < maxResults ? LimitBy.UNLIMITED : limitBy,
PermissionEvaluationMode.EAGER, searchParameters);
}
示例2: create
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
public static QueryOptions create(SearchParameters searchParameters)
{
QueryOptions options = new QueryOptions(searchParameters.getQuery(), null);
options.setIncludeInTransactionData(!searchParameters.excludeDataInTheCurrentTransaction());
options.setDefaultFTSConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
options.setDefaultFTSFieldConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
options.setSkipCount(searchParameters.getSkipCount());
options.setMaxPermissionChecks(searchParameters.getMaxPermissionChecks());
options.setMaxPermissionCheckTimeMillis(searchParameters.getMaxPermissionCheckTimeMillis());
options.setDefaultFieldName(searchParameters.getDefaultFieldName());
if (searchParameters.getLimitBy() == LimitBy.FINAL_SIZE)
{
options.setMaxItems(searchParameters.getLimit());
}
else
{
options.setMaxItems(searchParameters.getMaxItems());
}
options.setMlAnalaysisMode(searchParameters.getMlAnalaysisMode());
options.setLocales(searchParameters.getLocales());
options.setStores(searchParameters.getStores());
options.setQueryParameterDefinitions(searchParameters.getQueryParameterDefinitions());
///options.setQuery(query); Done on construction.
options.setUseInMemorySort(searchParameters.getUseInMemorySort());
options.setMaxRawResultSetSizeForInMemorySort(searchParameters.getMaxRawResultSetSizeForInMemorySort());
options.setBulkFetchEnabled(searchParameters.isBulkFetchEnabled());
options.setExcludeTenantFilter(searchParameters.getExcludeTenantFilter());
options.setQueryConsistency(searchParameters.getQueryConsistency());
options.setSinceTxId(searchParameters.getSinceTxId());
for(String name : searchParameters.getQueryTemplates().keySet())
{
String template = searchParameters.getQueryTemplates().get(name);
options.addQueryTemplate(name, template);
}
return options;
}
示例3: create
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
public static CMISQueryOptions create(SearchParameters searchParameters)
{
String sql = searchParameters.getQuery();
CMISQueryOptions options = new CMISQueryOptions(sql, searchParameters.getStores().get(0));
options.setIncludeInTransactionData(!searchParameters.excludeDataInTheCurrentTransaction());
options.setDefaultFTSConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
options.setDefaultFTSFieldConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
options.setSkipCount(searchParameters.getSkipCount());
options.setMaxPermissionChecks(searchParameters.getMaxPermissionChecks());
options.setMaxPermissionCheckTimeMillis(searchParameters.getMaxPermissionCheckTimeMillis());
if (searchParameters.getLimitBy() == LimitBy.FINAL_SIZE)
{
options.setMaxItems(searchParameters.getLimit());
}
else
{
options.setMaxItems(searchParameters.getMaxItems());
}
options.setMlAnalaysisMode(searchParameters.getMlAnalaysisMode());
options.setLocales(searchParameters.getLocales());
options.setStores(searchParameters.getStores());
options.setUseInMemorySort(searchParameters.getUseInMemorySort());
options.setMaxRawResultSetSizeForInMemorySort(searchParameters.getMaxRawResultSetSizeForInMemorySort());
//options.setQuery(); Done on conbstruction
//options.setQueryMode(); Should set afterwards
options.setQueryParameterDefinitions(searchParameters.getQueryParameterDefinitions());
options.setDefaultFieldName(searchParameters.getDefaultFieldName());
options.setBulkFetchEnabled(searchParameters.isBulkFetchEnabled());
options.setExcludeTenantFilter(searchParameters.getExcludeTenantFilter());
options.setSinceTxId(searchParameters.getSinceTxId());
for(String name : searchParameters.getQueryTemplates().keySet())
{
String template = searchParameters.getQueryTemplates().get(name);
options.addQueryTemplate(name, template);
}
return options;
}