01: package org.araneaframework.example.main.business.data;
02:
03: import java.util.List;
04: import org.araneaframework.example.main.business.model.GeneralMO;
05:
06: public interface IGeneralDAO {
07:
08: /**
09: * Reads an object with specified class and Id. Returned object can be casted
10: * into specified class afterwards.
11: *
12: * @param clazz
13: * object's class.
14: * @param id
15: * object's Id.
16: * @return object with the specified Id and class.
17: */
18: public abstract GeneralMO getById(Class clazz, Long id);
19:
20: /**
21: * Reads all objects with specified class. Returned objects can be casted into
22: * specified class afterwards.
23: *
24: * @param clazz
25: * objects' class.
26: * @return all objects with the specified class.
27: */
28: public abstract List getAll(Class clazz);
29:
30: /**
31: * Stores a new object and returns its Id.
32: *
33: * @param object
34: * object.
35: * @return object's Id.
36: */
37: public abstract Long add(GeneralMO object);
38:
39: /**
40: * Stores an existing object.
41: *
42: * @param object
43: * object.
44: */
45: public abstract void edit(GeneralMO object);
46:
47: /**
48: * Removes an object with specified class and Id.
49: *
50: * @param clazz
51: * object's class.
52: * @param id
53: * object's Id.
54: */
55: public abstract void remove(Class clazz, Long id);
56:
57: }
|