1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oness.common.model.dao;
17
18 import java.io.Serializable;
19
20 import net.sf.oness.common.model.bo.AuditableBusinessObject;
21
22 /***
23 * Interface to be implemented by Data Access Objects that allow data auditing
24 *
25 * @author Carlos Sanchez
26 * @version $Revision: 1.12 $
27 */
28 public interface AuditableDao {
29
30 /***
31 * Find an object by its identifier. This should return only the specified
32 * entity, not the associated ones.
33 *
34 * This method returns the same object passed as argument.
35 *
36 * @param id
37 * identifier
38 * @return the value with that id, may have properties not initialized
39 * @throws org.springframework.dao.DataRetrievalFailureException
40 * if an object with that id doesn't exist
41 */
42 public AuditableBusinessObject findById(Serializable id);
43
44 /***
45 * Create a new object, the id value will be ignored
46 *
47 * @param value
48 * @return the value created (with id, transactionTime and needed properties
49 * initialized)
50 */
51 public AuditableBusinessObject create(AuditableBusinessObject value);
52
53 /***
54 * Update an object
55 *
56 * @param value
57 * value to update
58 * @return the updated value
59 * @throws org.springframework.dao.OptimisticLockingFailureException
60 * if the value has been already updated or deleted
61 */
62 public AuditableBusinessObject update(AuditableBusinessObject value);
63
64 /***
65 * Find an object and all related entities by its identifier.
66 *
67 * @param id
68 * identifier
69 * @return the value with that id and all properties initialized
70 * @throws org.springframework.dao.DataRetrievalFailureException
71 * if an object with that id doesn't exist
72 */
73 public AuditableBusinessObject findWithDetails(Serializable id);
74
75 }