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

com.versioneye.persistence.mongodb.VersionchangeDao 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.Versionchange;
import com.versioneye.persistence.IVersionchangeDao;

/**
 * Created by IntelliJ IDEA.
 * User: reiz
 * Date: 2/8/12
 * Time: 3:44 PM
 */
public class VersionchangeDao implements IVersionchangeDao {

    private static final String VERSIONCHANGE = "versionchanges";
    private MongoDB mongoDB;

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

    public Versionchange create(Versionchange versionchange) {
        DBCollection collection = getCollection();
        collection.insert(versionchange.getDBObject());
        return versionchange;
    }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy