manager.java

来自「自己写的一个struts+spring+hibernate测试程序」· Java 代码 · 共 56 行

JAVA
56
字号
/*
 * Created on 2006-2-16
 */
package com.base;

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

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: epro</p>
 * @author tommy.zeng
 * @version 1.0
 */
public interface Manager {
    
    /**
     * Expose the setDAO method for testing purposes
     * @param dao
     */
    public void setDAO(BaseDAO dao);
    
    /**
     * Generic method used to get a all objects of a particular type. 
     * @param clazz the type of objects 
     * @return List of populated objects
     */
    public List getObjects(Class clazz);
    
    /**
     * Generic method to get an object based on class and identifier. 
     * 
     * @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);

    /**
     * Generic method to save an object.
     * @param o the object to save
     */
    public void saveObject(Object o);

    /**
     * Generic method to delete an object based on class and id
     * @param clazz model class to lookup
     * @param id the identifier of the class
     */
    public void removeObject(Class clazz, Serializable id);
    
    public void batchRemoveObject(Class clazz, String[] id);
}

⌨️ 快捷键说明

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