Examples of MongoDBObject


Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

    @Override
    public int nextSequenceValue(String sequenceName) {
        QueryMongoDBObject query = new QueryMongoDBObject().forID(sequenceName);
        UpdateMongoDBObject update = new UpdateMongoDBObject().$inc(SEQUENCE_VALUE_PROPERTY_NAME);

        MongoDBObject modifiedObject = new MongoDBObject(getSequenceCollection().findAndModify(query, null, null, false, update, true, true));
        return modifiedObject.getInt(SEQUENCE_VALUE_PROPERTY_NAME);
    }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

            logQueryDetails(dbCursor);

            return Iterables.transform(dbCursor, new Function<DBObject, T>() {
                @Override
                public T apply(DBObject dbObject) {
                    return _modelMarshaller.fromDBObject(new MongoDBObject(dbObject));
                }
            });
        } finally {
            dbCursor.close();
        }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

        DBCursor dbCursor = getPrimaryCollection().find(convertCriteriaToDBObject(criteria)).sort(convertSortOrderToDBObject(sortOrder)).limit(1);
        try {
            logQueryDetails(dbCursor);

            Iterator<DBObject> iter = dbCursor.iterator();
            return iter.hasNext() ? _modelMarshaller.fromDBObject(new MongoDBObject(iter.next())) : null;
        } finally {
            dbCursor.close();
        }
    }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

            logQueryDetails(dbCursor);

            List<T> list = Lists.newArrayList();
            for (DBObject dbObject : dbCursor) {
                list.add(_modelMarshaller.fromDBObject(new MongoDBObject(dbObject)));
            }
            return new SimpleQueryResults<T>(list, startIndex, dbCursor.count());
        } finally {
            dbCursor.close();
        }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

            Iterator<DBObject> iterator = dbCursor.iterator();
            if (!iterator.hasNext()) {
                return null;
            }

            object = _modelMarshaller.fromDBObject(new MongoDBObject(iterator.next()));
            cacheObject(object);

            return object;
        } finally {
            dbCursor.close();
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

            logQueryDetails(dbCursor);

            return Iterables.transform(dbCursor, new Function<DBObject, T>() {
                @Override
                public T apply(DBObject dbObject) {
                    return _modelMarshaller.fromDBObject(new MongoDBObject(dbObject));
                }
            });
        } finally {
            dbCursor.close();
        }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

        DBCursor dbCursor = getPrimaryCollection().find(convertCriteriaToDBObject(criteria)).sort(convertSortOrderToDBObject(sortOrder)).limit(1);
        try {
            logQueryDetails(dbCursor);

            Iterator<DBObject> iter = dbCursor.iterator();
            return iter.hasNext() ? _modelMarshaller.fromDBObject(new MongoDBObject(iter.next())) : null;
        } finally {
            dbCursor.close();
        }
    }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

            logQueryDetails(dbCursor);

            List<T> list = Lists.newArrayList();
            for (DBObject dbObject : dbCursor) {
                list.add(_modelMarshaller.fromDBObject(new MongoDBObject(dbObject)));
            }
            return new SimpleQueryResults<T>(list, startIndex, dbCursor.count());
        } finally {
            dbCursor.close();
        }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

        DBObject dbObject = getPrimaryCollection().findOne(new QueryMongoDBObject().forID(objectID));
        if (dbObject == null) {
            return null;
        }

        object = _modelMarshaller.fromDBObject(new MongoDBObject(dbObject));
        cacheObject(object);

        return object;
    }
View Full Code Here

Examples of com.bazaarvoice.commons.data.dao.mongo.dbo.MongoDBObject

        logQueryDetails(dbCursor);

        return Iterables.transform(dbCursor, new Function<DBObject, T>() {
            @Override
            public T apply(DBObject dbObject) {
                return _modelMarshaller.fromDBObject(new MongoDBObject(dbObject));
            }
        });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.