All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.versioneye.persistence.mongodb.NewestDao Maven / Gradle / Ivy

Go to download

This is the java implementation of the VersionEye core services. It contains some buisiness logic and utility classes.

There is a newer version: 1.3.7
Show newest version
package com.versioneye.persistence.mongodb;

import com.mongodb.DBCollection;
import com.versioneye.domain.Newest;
import com.versioneye.persistence.INewestDao;

/**
 * Created by IntelliJ IDEA.
 * User: reiz
 * Date: 4/8/12
 * Time: 5:38 PM
 *
 */
public class NewestDao implements INewestDao {

    private static final String NEWEST = "newests";
    private MongoDB mongoDB;

    private DBCollection getCollection(){
        return mongoDB.getDb().getCollection(NEWEST);
    }

    public void create(Newest newest) {
        DBCollection newestCollection = getCollection();
        newestCollection.insert(newest.getDBObject());
    }

    public void setMongoDB(MongoDB mongoDB) {
        this.mongoDB = mongoDB;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy