KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > appfuse > service > Manager


1 package org.appfuse.service;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.List JavaDoc;
5
6 import org.appfuse.dao.Dao;
7
8 public interface Manager {
9     
10     /**
11      * Expose the setDao method for testing purposes
12      * @param dao
13      */

14     public void setDao(Dao dao);
15     
16     /**
17      * Generic method used to get a all objects of a particular type.
18      * @param clazz the type of objects
19      * @return List of populated objects
20      */

21     public List JavaDoc getObjects(Class JavaDoc clazz);
22     
23     /**
24      * Generic method to get an object based on class and identifier.
25      *
26      * @param clazz model class to lookup
27      * @param id the identifier (primary key) of the class
28      * @return a populated object
29      * @see org.springframework.orm.ObjectRetrievalFailureException
30      */

31     public Object JavaDoc getObject(Class JavaDoc clazz, Serializable JavaDoc id);
32
33     /**
34      * Generic method to save an object.
35      * @param o the object to save
36      */

37     public void saveObject(Object JavaDoc o);
38
39     /**
40      * Generic method to delete an object based on class and id
41      * @param clazz model class to lookup
42      * @param id the identifier of the class
43      */

44     public void removeObject(Class JavaDoc clazz, Serializable JavaDoc id);
45 }
46
Popular Tags