@Override protected DBCursor runMongoCommand() { return getDBCollection().find(query, projection); } }
/** * When EntityInfo is updated, we have to make sure any active/deprecated metadata is still valid */ protected void validateAllVersions(EntityInfo ei) { LOGGER.debug("Validating all versions of {}", ei.getName()); String version = null; try { DBCursor cursor = new FindCommand(collection, new BasicDBObject(LITERAL_NAME, ei.getName()). append(LITERAL_VERSION, new BasicDBObject("$exists", 1)). append(LITERAL_STATUS_VALUE, new BasicDBObject("$ne", MetadataParser.toString(MetadataStatus.DISABLED))), null).executeAndUnwrap(); while (cursor.hasNext()) { DBObject object = cursor.next(); EntitySchema schema = mdParser.parseEntitySchema(object); version = schema.getVersion().getValue(); LOGGER.debug("Validating {} {}", ei.getName(), version); EntityMetadata md = new EntityMetadata(ei, schema); md.validate(); } } catch (Exception e) { String msg = ei.getName() + ":" + version + e.toString(); throw analyzeException(e, MongoMetadataConstants.ERR_UPDATE_INVALIDATES_METADATA, msg); } }
append(LITERAL_STATUS, 1). append(LITERAL_ID, 0); DBCursor cursor = new FindCommand(collection, query, project).execute(); int n = cursor.count(); VersionInfo[] ret = new VersionInfo[n];
Long to) { LOGGER.debug("Submitting query {}",mongoQuery); DBCursor cursor = new FindCommand(coll, mongoQuery, mongoProjection).executeAndUnwrap(); LOGGER.debug("Query evaluated"); if (mongoSort != null) {
try { cursor = new FindCommand(collection, mongoQuery, null).executeAndUnwrap(); LOGGER.debug("Found {} documents", cursor.count());
@Override protected DBCursor runMongoCommand() { DBObject q=query==null?new BasicDBObject():query; return getDBCollection().find(q, projection); } }
append(LITERAL_STATUS, 1). append(LITERAL_ID, 0); DBCursor cursor = new FindCommand(collection, query, project).executeAndUnwrap(); int n = cursor.count(); VersionInfo[] ret = new VersionInfo[n];
try { ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.PRE_CRUD_UPDATE_RESULTSET, ctx); cursor = new FindCommand(collection, query, null).executeAndUnwrap(); LOGGER.debug("Found {} documents", cursor.count()); ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.POST_CRUD_UPDATE_RESULTSET, ctx);