package br.com.vepo.datatransform.model;

import org.springframework.beans.factory.annotation.Autowired;

public abstract class Repository<T> {
	@Autowired
	protected MongoConnection mongoConnection;

	public <V> T find(Class<T> clazz, V key) {
		return mongoConnection.getMorphiaDataStore().get(clazz, key);
	}

	public void persist(T obj) {
		mongoConnection.getMorphiaDataStore().save(obj);
	}
}
