Package com.mongodb

Examples of com.mongodb.BasicDBObject


      mongoClient.getDatabaseNames();

      logger.info("removing component");
      DBCollection ME = db.getCollection(Entities);

      BasicDBObject created = new BasicDBObject("name", comp.getName())
          .append("time", System.currentTimeMillis()).append("op",
              "deleted");
      ME.insert(created);

    } catch (MongoException e) {
View Full Code Here


      // force connection to be established
      mongoClient.getDatabaseNames();

      DBCollection ChangedLink = db.getCollection(Links);

      BasicDBObject newLink = new BasicDBObject("name", wire.getSource()
          .getName()).append("time", System.currentTimeMillis())
          .append("linkType", "Wire")
          .append("linkId", wire.getName())
          .append("removed", wire.getDestination().getName());
View Full Code Here

        this.ldapSettingsFactory = ldapSettingsFactory;
    }

    @Override
    public LdapSettings load() {
        DBObject query = new BasicDBObject();
        final List<DBObject> results = query(LdapSettingsImpl.class, query);
        if (results.size() == 0) {
            return null;
        }
        if (results.size() > 1) {
View Full Code Here

        return ldapSettingsFactory.create((ObjectId) settingsObject.get("_id"), settingsObject.toMap());
    }

    @Override
    public void delete() {
        DBObject query = new BasicDBObject();
        destroyAll(LdapSettingsImpl.class, query);
    }
View Full Code Here

    protected PersistedServiceImpl(MongoConnection mongoConnection) {
        this.mongoConnection = mongoConnection;
    }

    protected DBObject get(ObjectId id, String collectionName) {
        return collection(collectionName).findOne(new BasicDBObject("_id", id));
    }
View Full Code Here

    protected DBObject get(ObjectId id, String collectionName) {
        return collection(collectionName).findOne(new BasicDBObject("_id", id));
    }

    protected <T extends Persisted> DBObject get(Class<T> modelClass, ObjectId id) {
        return collection(modelClass).findOne(new BasicDBObject("_id", id));
    }
View Full Code Here

    protected <T extends Persisted> DBObject findOne(Class<T> model, DBObject query) {
        return collection(model).findOne(query);
    }

    protected <T extends Persisted> DBObject findOne(Class<T> model, DBObject query, DBObject sort) {
        return collection(model).findOne(query, new BasicDBObject(), sort);
    }
View Full Code Here

    protected DBObject findOne(DBObject query, String collectionName) {
        return collection(collectionName).findOne(query);
    }

    protected DBObject findOne(DBObject query, DBObject sort, String collectioName) {
        return collection(collectioName).findOne(query, new BasicDBObject(), sort);
    }
View Full Code Here

        return collection(modelClass).count();
    }

    @Override
    public <T extends Persisted> int destroy(T model) {
        return collection(model).remove(new BasicDBObject("_id", new ObjectId(model.getId()))).getN();
    }
View Full Code Here

        return collection(model).remove(new BasicDBObject("_id", new ObjectId(model.getId()))).getN();
    }

    @Override
    public <T extends Persisted> int destroyAll(Class<T> modelClass) {
        return collection(modelClass).remove(new BasicDBObject()).getN();
    }
View Full Code Here

TOP

Related Classes of com.mongodb.BasicDBObject

Copyright © 2018 www.massapicom. 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.