本文整理了Java中org.xwiki.query.Query.setOffset
方法的一些代码示例,展示了Query.setOffset
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setOffset
方法的具体详情如下:
包路径:org.xwiki.query.Query
类名称:Query
方法名:setOffset
暂无
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public Query setOffset(int offset)
{
this.query.setOffset(offset);
return this;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-query-manager
@Override
public Query setOffset(int offset)
{
return getWrappedQuery().setOffset(offset);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-solr-api
/**
* Fetches the next 'page' of results from the database.
*/
private void fetchNextResults()
{
try {
// We use basic pagination (absolute offset) because we don't expect the database to change too much while
// the synchronization takes place. Also, the database is used as the reference store, meaning that we
// update the Solr index to match the database, not the other way around.
results = getQuery().setWiki(wiki).setOffset(offset).execute();
offset += LIMIT;
} catch (QueryException e) {
results = Collections.emptyList();
logger.error("Failed to query the database.", e);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-watchlist-api
query.setOffset(start);
query.setLimit(nb);
query.bindValues(values);
代码示例来源:origin: phenotips/phenotips
private List<String> runQuery(String queryString, String formattedInput, int resultsLimit)
{
Query query = null;
List<String> queryResults = null;
try {
query = this.qm.createQuery(queryString, Query.XWQL);
if (resultsLimit > 0) {
query.setLimit(resultsLimit);
query.setOffset(0);
}
if (StringUtils.isNotBlank(formattedInput)) {
query.bindValue(UsersAndGroups.INPUT_PARAMETER, formattedInput);
}
queryResults = query.execute();
} catch (QueryException e) {
this.logger.error("Error while performing query: [{}] ", queryString, e.getMessage());
return Collections.emptyList();
}
return queryResults;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-messagestream-api
@Override
public List<Event> getRecentPersonalMessages(DocumentReference author, int limit, int offset)
{
List<Event> result = new ArrayList<Event>();
try {
Query q = this.qm.createQuery(
"where event.application = 'MessageStream' and event.type = 'personalMessage'"
+ " and event.user = :user order by event.date desc",
Query.XWQL);
q.bindValue("user", this.serializer.serialize(author));
q.setLimit(limit > 0 ? limit : 30).setOffset(offset >= 0 ? offset : 0);
result = this.stream.searchEvents(q);
} catch (QueryException ex) {
LOG.warn("Failed to search personal messages: {}", ex.getMessage());
}
return result;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-messagestream-api
@Override
public List<Event> getRecentMessagesForGroup(DocumentReference group, int limit, int offset)
{
List<Event> result = new ArrayList<Event>();
try {
Query q = this.qm.createQuery(
"where event.application = 'MessageStream' and event.type = 'groupMessage'"
+ " and event.stream = :group order by event.date desc",
Query.XWQL);
q.bindValue("group", this.serializer.serialize(group));
q.setLimit(limit > 0 ? limit : 30).setOffset(offset >= 0 ? offset : 0);
result = this.stream.searchEvents(q);
} catch (QueryException ex) {
LOG.warn("Failed to search group messages: {}", ex.getMessage());
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryManager.createQuery(query, Query.XWQL).bindValue("date", new Date(ts)).setLimit(number).setOffset(
start).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryResult =
queryManager.createQuery(query, Query.XWQL).bindValue("space", spaceName).bindValue("name", pageName)
.setLimit(number).bindValue("language", "").setOffset(start).execute();
代码示例来源:origin: org.xwiki.platform/xwiki-platform-messagestream-api
@Override
public List<Event> getRecentDirectMessages(int limit, int offset)
{
List<Event> result = new ArrayList<Event>();
try {
Query q = this.qm.createQuery(
"where event.application = 'MessageStream' and event.type = 'directMessage'"
+ " and event.stream = :targetUser order by event.date desc",
Query.XWQL);
q.bindValue("targetUser", this.serializer.serialize(this.bridge.getCurrentUserReference()));
q.setLimit(limit > 0 ? limit : 30).setOffset(offset >= 0 ? offset : 0);
result = this.stream.searchEvents(q);
} catch (QueryException ex) {
LOG.warn("Failed to search direct messages: {}", ex.getMessage());
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryResult =
queryManager.createQuery(query, Query.XWQL).bindValue("space", spaceName).bindValue("name", pageName)
.setLimit(number).bindValue("language", language).setOffset(start).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
"select distinct doc.fullName from XWikiDocument as doc where doc.parent = :parent order by doc.fullName asc";
List<String> childPageFullNames =
queryManager.createQuery(queryString, Query.XWQL).bindValue("parent", doc.getFullName()).setOffset(start)
.setLimit(number).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
Query query = queryManager.createQuery(queryString, Query.XWQL).setLimit(number).setOffset(start);
for (String param : filters.keySet()) {
query.bindValue(param, String.format("%%%s%%", filters.get(param).toUpperCase()));
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryManager.getNamedQuery("getSpaces").setOffset(start).setLimit(number).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
query.setOffset(start);
query.setLimit(nb);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryManager.getNamedQuery("getSpaceDocsName").bindValue("space", spaceName).setOffset(start).setLimit(
number).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
queryResult =
queryManager.createQuery(query, Query.XWQL).bindValue("className", className).setLimit(number)
.setOffset(start).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
queryManager.createQuery(query, Query.XWQL).bindValue("date", date).setLimit(numberOfResults).setOffset(
start).execute();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
query.setOffset(offset);
query.setLimit(limit);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
.createQuery(
"/*/*[obj/XWiki/" + (user ? CLASS_SUFFIX_XWIKIUSERS : CLASS_SUFFIX_XWIKIGROUPS)
+ "]/@fullName", Query.XPATH).setLimit(nb).setOffset(start).execute();
} catch (QueryException ex) {
throw new XWikiException(0, 0, ex.getMessage(), ex);
内容来源于网络,如有侵权,请联系作者删除!