/**
 * 基础持久化接口
 * IBaseDao.java
 * Copyright (C) 2010 SLMS
 * Simple Logistics Management System
 * 
 */
package com.zds.slms.common;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.LockMode;
import org.springframework.dao.DataAccessException;

/**
 * Copyright (C) 2010:SLMS<br/>
 * Project:SLMS<br/>
 * Module ID:<br/>
 * Comments:Simple Logistics Management System<br/>
 * JDK version used:JDK1.6<br/>
 * Package:com.zds.slms.common<br/>
 * Author:chenyongzheng<br/>
 * Create Date:2010-12-3<br/>
 * Modified By:<br/>
 * Modified Date:<br/>
 * Why & What is modified:<br/>
 * Version:0.1<br/>
 */
public interface IBaseDao<T, ID extends Serializable> {
	public T load(ID id) throws DataAccessException;

	public T get(ID id) throws DataAccessException;

	public boolean contains(T t) throws DataAccessException;

	public void refresh(T t, LockMode lockMode) throws DataAccessException;

	public void refresh(T t) throws DataAccessException;

	public Serializable save(T t) throws DataAccessException;

	public void saveOrUpdate(T t) throws DataAccessException;

	public void saveOrUpdateAll(Collection<T> entities)
			throws DataAccessException;

	public void update(T t, LockMode lockMode) throws DataAccessException;

	public void update(T t) throws DataAccessException;

	public void delete(T t, LockMode lockMode) throws DataAccessException;

	public void delete(T t) throws DataAccessException;

	public void deleteAll(Collection<T> entities) throws DataAccessException;

	public List<T> find(String queryString, Object value)
			throws DataAccessException;

	public List<T> find(String queryString, Object[] values)
			throws DataAccessException;

	public List<T> find(String queryString) throws DataAccessException;

	public List<T> list() throws DataAccessException;

	public List<T> findByNamedQuery(String queryName)
			throws DataAccessException;

	public List<T> findByNamedQuery(String queryName, Object value)
			throws DataAccessException;

	public List<T> findByNamedQuery(String queryName, Object[] values)
			throws DataAccessException;

}