com.versioneye.persistence.mongodb.NewestDao Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of versioneye-core-j Show documentation
Show all versions of versioneye-core-j Show documentation
This is the java implementation of the VersionEye core services. It contains
some buisiness logic and utility classes.
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