/*
 * Created on Jun 9, 2006
 * 
 * (C) Copyright TANDBERG Television Ltd.
 */

package com.tandbergtv.watchpoint.pmm.dao.hibernate;

import java.io.Serializable;
import java.util.List;

/**
 * Marker Interface used for each of the Data Access Interfaces
 * 
 * @author Vijay Silva
 * 
 * @param <DO>
 *            The Data Object
 * @param <DOK>
 *            The Data Object Key
 */
public interface DataAccessInterface<DO, DOK extends Serializable>
{
	/**
	 * @param object
	 *            The Object to create in the persistence layer
	 * 
	 * @return The created Object
	 */
	DO create(DO object);

	/**
	 * @param object
	 *            The Object to update for persistence layer.
	 * 
	 * @return The Persisted object
	 */
	DO update(DO object);

	/**
	 * Deletes the Object from the persistence layer
	 * 
	 * @param key
	 *            The Key to the object that needs to be deleted
	 */
	void delete(DOK key);

	/**
	 * Method to find a single entity given the Key
	 * 
	 * @param key
	 *            The key to the object that needs to be fetched
	 * 
	 * @return The Matching Object in the persistence layer
	 */
	DO findByKey(DOK key);

	/**
	 * Method to find all DataObjects of the current Entity
	 * 
	 * @return The list of all DataObjects stored in the persistence layer
	 */
	List<DO> findAll();
}
