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

com.rhcloud.mongo.dao.MongoDBDao Maven / Gradle / Ivy

The newest version!

/**
 * 
 * Copyright 2013 John D. Herson
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

package com.rhcloud.mongo.dao;

import org.bson.types.ObjectId;

import com.mongodb.DB;
import com.rhcloud.mongo.Query;

/**
 * @author jherson
 *
 */
public interface MongoDBDao {
	
	/**
	 * 
	 * @param db
	 */
	
	public void setDB(DB db);
	
	/**
	 * insert
	 * @param clazz
	 * @param object
	 * @return T
	 */
	
	public  T insert(Class clazz, Object object);
	
	/**
	 * 
	 * @param clazz
	 * @param object
	 * @return T
	 */
	
	public  T update(Class clazz, Object object);
	
	/**
	 * delete
	 * @param clazz
	 * @param object
	 */
	
	public  void delete(Class clazz, Object object);
	
	/**
	 * find
	 * @param clazz
	 * @param id
	 * @return T
	 */
	
	public  T find(Class clazz, ObjectId id);	
	
	/**
	 * createQuery
	 * @return Query
	 */
	
	public Query createQuery();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy