package com.ifish.dao;

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

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;

import com.ifish.hibernate.Pagination;

/** 
 * @ClassName: BaseDao 
 * @Description: TODO 
 * @author ggw 
 *  
 */
public interface BaseDao<T, ID extends Serializable> {
	
	public T get(ID id);
	
	public T save(T t);
	
	public T update(T t);
	
	public T saveOrUpdate(T t);
	
	public void delete(T t);
	
	public List<T> findByProperty(Criterion... criterions);
	
	public List<T> findByProperty(Order order,Criterion... criterions);
	
	public T findUniqueByProperty(Criterion... criterions);
	
	public Pagination<T> findByCriteria(Integer firstResult,Integer pageSize,Order order,Criterion... criterion);
	
}
