dao.java

来自「这是本人曾经在公司里用的,内部开发框架,基于struts+hibernate今天」· Java 代码 · 共 59 行

JAVA
59
字号
/**
 * 
 */
package cn.bway.common.dao;

import java.io.Serializable;

import cn.bway.common.BwayHibernateException;
import cn.bway.common.vo.QueryVO;

/**
 * @author Kson
 *
 */
public interface DAO {
	
    /**
     * Generic method used to get all objects of a particular type. This
     * is the same as lookup up all rows in a table.
     * @param clazz the type of objects (a.k.a. while table) to get data from
     * @return List of populated objects
     */
    public Object getObjects(Class clazz,QueryVO qvo) throws BwayHibernateException;
    
    
    public Object getObjects(Class clazz) throws BwayHibernateException;
    
    /**
     * Generic method to get an object based on class and identifier. An 
     * ObjectRetrievalFailureException Runtime Exception is thrown if 
     * nothing is found.
     * 
     * @param clazz model class to lookup
     * @param id the identifier (primary key) of the class
     * @return a populated object
     * @see org.springframework.orm.ObjectRetrievalFailureException
     */
    public Object getObject(Class clazz, Serializable id) throws BwayHibernateException;

    /**
     * Generic method to save an object - handles both update and insert.
     * @param o the object to save
     * @throws BwayHibernateException 
     */
    public void saveObject(Object o) throws BwayHibernateException;
    
    public Serializable saveObject_ReturnID(Object o) throws BwayHibernateException;

    public void updateObject(Object obj) throws BwayHibernateException ;
     /**
     * Generic method to delete an object based on class and id
     * @param clazz model class to lookup
     * @param id the identifier (primary key) of the class
     */
    public void removeObject(Class clazz, Serializable id) throws BwayHibernateException;
    
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?