本文整理汇总了Java中org.ektorp.ViewQuery.includeDocs方法的典型用法代码示例。如果您正苦于以下问题:Java ViewQuery.includeDocs方法的具体用法?Java ViewQuery.includeDocs怎么用?Java ViewQuery.includeDocs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ektorp.ViewQuery
的用法示例。
在下文中一共展示了ViewQuery.includeDocs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getViewQuery
import org.ektorp.ViewQuery; //导入方法依赖的package包/类
private ViewQuery getViewQuery(StatementFilter filter, int limit,
boolean ascending) {
ViewQuery viewQuery = new ViewQuery(mapper).designDocId(
"_design/statements").viewName(viewName);
Object startKey = ascending ? getStartKey(filter) : getEndKey(filter);
if (startKey != null) {
viewQuery.startKey(startKey);
}
Object endKey = ascending ? getEndKey(filter) : getStartKey(filter);
if (endKey != null) {
viewQuery.endKey(endKey);
}
if (!ascending) {
viewQuery.descending(true);
}
// fetch one too many for paging-check
viewQuery.limit(limit + 1);
String startId = filter.getStartId();
if (startId != null) {
viewQuery.startDocId(startId);
}
viewQuery.includeDocs(true);
viewQuery.staleOkUpdateAfter();
return viewQuery;
}
示例2: findAllGameRun
import org.ektorp.ViewQuery; //导入方法依赖的package包/类
@Override
public List<GameRun> findAllGameRun(int limit) {
ViewQuery q = createQuery("by_result");
q.includeDocs(true);
q.descending(true);
if (limit != -1) {
q.limit(limit);
}
return db.queryView(q, type);
}
示例3: findAllGameWinners
import org.ektorp.ViewQuery; //导入方法依赖的package包/类
@Override
public List<GameWinners> findAllGameWinners(Date startDate, Date endDate) {
ViewQuery q = createQuery("all");
q.includeDocs(true);
q.descending(true);
if (startDate != null) {
q.startKey(startDate);
}
if (endDate != null) {
q.endKey(endDate);
}
return db.queryView(q, type);
}
示例4: configure
import org.ektorp.ViewQuery; //导入方法依赖的package包/类
/**
* Configures Ektorp's {@link ViewQuery} with the given {@link ViewParams}.
*
* @param view the Ektorp object to be configured
* @param params the parameters that shall be used
*/
public void configure(ViewQuery view, ViewParams params) {
if (params.getAttachments() != null) {
throw new UnsupportedViewParameterException("attachments");
}
if (params.getAttEncodingInfo() != null) {
throw new UnsupportedViewParameterException("att_encoding_info");
}
if (params.getConflicts() != null) {
throw new UnsupportedViewParameterException("conflicts");
}
if (params.getDescending() != null) {
view.descending(params.getDescending());
}
if (params.getGroup() != null) {
view.group(params.getGroup());
}
if (params.getIncludeDocs() != null) {
view.includeDocs(params.getIncludeDocs());
}
if (params.getInclusiveEnd() != null) {
view.inclusiveEnd(params.getInclusiveEnd());
}
if (params.getReduce() != null) {
view.reduce(params.getReduce());
}
if (params.getUpdateSeq() != null) {
view.updateSeq(params.getUpdateSeq());
}
if (params.getEndKey() != null) {
view.endKey(params.getEndKey());
}
if (params.getEndKeyDocId() != null) {
view.endDocId(params.getEndKeyDocId());
}
if (params.getGroupLevel() != null) {
view.groupLevel(params.getGroupLevel());
}
if (params.getKey() != null) {
view.key(params.getKey());
}
if (params.getLimit() != null) {
view.limit(params.getLimit());
}
if (params.getSkip() != null) {
view.skip(params.getSkip());
}
if (params.getStale() != null) {
if ("ok".equals(params.getStale())) {
view.staleOk(true);
} else if ("update_after".equals(params.getStale())) {
view.staleOkUpdateAfter();
}
}
if (params.getStartKey() != null) {
view.startKey(params.getStartKey());
}
if (params.getStartKeyDocId() != null) {
view.startDocId(params.getStartKeyDocId());
}
//
if (params.getDesignDocument() != null) {
view.designDocId("_design/" + params.getDesignDocument());
}
if (params.getView() != null) {
view.viewName(params.getView());
}
}