org.mongodb.morphia.query.Query.getOffset()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中org.mongodb.morphia.query.Query.getOffset方法的一些代码示例,展示了Query.getOffset的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getOffset方法的具体详情如下:
包路径:org.mongodb.morphia.query.Query
类名称:Query
方法名:getOffset

Query.getOffset介绍

暂无

代码示例

代码示例来源:origin: org.actframework/act-morphia

@Override
public int getOffset() {
  return mq.getOffset();
}

代码示例来源:origin: org.mongodb.morphia/morphia

@Override
public <T> WriteResult delete(final Query<T> query, final DeleteOptions options) {
  DBCollection dbColl = query.getCollection();
  // TODO remove this after testing.
  if (dbColl == null) {
    dbColl = getCollection(query.getEntityClass());
  }
  if (query.getSortObject() != null || query.getOffset() != 0 || query.getLimit() > 0) {
    throw new QueryException("Delete does not allow sort/offset/limit query options.");
  }
  return dbColl.remove(query.getQueryObject(), enforceWriteConcern(options, query.getEntityClass()).getOptions());
}

代码示例来源:origin: org.mongodb.morphia/morphia

throw new QueryException("sorting is not allowed for updates.");
if (query.getOffset() > 0) {
  throw new QueryException("a query offset is not allowed for updates.");

代码示例来源:origin: org.mongodb.morphia/morphia

@SuppressWarnings("deprecation")
  MapReduceCommand toCommand(final Mapper mapper) {
    if (query.getOffset() != 0 || query.getFieldsObject() != null) {
      throw new QueryException("mapReduce does not allow the offset/retrievedFields query ");
    }

    final DBCollection dbColl = inputCollection != null ? getQuery().getCollection().getDB().getCollection(inputCollection)
                              : query.getCollection();
    final String target = outputCollection != null ? outputCollection : mapper.getMappedClass(resultType).getCollectionName();

    final MapReduceCommand command = new MapReduceCommand(dbColl, map, reduce, target, outputType, query.getQueryObject());
    command.setBypassDocumentValidation(bypassDocumentValidation);
    command.setCollation(collation);
    command.setFinalize(finalize);
    command.setJsMode(jsMode);
    command.setLimit(limit);
    command.setMaxTime(maxTimeMS, TimeUnit.MILLISECONDS);
    command.setOutputDB(outputDB);
    command.setReadPreference(readPreference);
    command.setScope(scope);
    command.setSort(query.getSortObject());
    command.setVerbose(verbose);

    return command;
  }
}

代码示例来源:origin: org.mongodb.morphia/morphia

Assert.parameterNotEmpty("reduce", baseCommand.getReduce());
if (query.getOffset() != 0 || query.getFieldsObject() != null) {
  throw new QueryException("mapReduce does not allow the offset/retrievedFields query options.");

相关文章