Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PersistableBusinessObject |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kns.bo; | |
17 | ||
18 | import java.util.List; | |
19 | ||
20 | import org.apache.ojb.broker.PersistenceBrokerAware; | |
21 | ||
22 | /** | |
23 | * Declares common methods for all persistable objects. | |
24 | */ | |
25 | public interface PersistableBusinessObject extends BusinessObject, PersistenceBrokerAware { | |
26 | ||
27 | /** | |
28 | * @return object versionm number, used by optimistic locking | |
29 | */ | |
30 | public Long getVersionNumber(); | |
31 | ||
32 | /** | |
33 | * Sets object's version number, used by optimistic locking | |
34 | * | |
35 | * @param versionNumber | |
36 | */ | |
37 | public void setVersionNumber(Long versionNumber); | |
38 | ||
39 | /** | |
40 | * @return objectID, the unique identifier for the object | |
41 | */ | |
42 | public String getObjectId(); | |
43 | ||
44 | /** | |
45 | * Sets the unique identifer for the object | |
46 | * | |
47 | * @param objectId | |
48 | */ | |
49 | public void setObjectId(String objectId); | |
50 | ||
51 | ||
52 | public abstract boolean isBoNotesSupport(); | |
53 | ||
54 | /** | |
55 | * @return Returns the boNotes List. | |
56 | */ | |
57 | public abstract List getBoNotes(); | |
58 | ||
59 | /** | |
60 | * @see org.kuali.rice.kns.bo.BusinessObject#refreshNonUpdateableReferences() | |
61 | */ | |
62 | public abstract void refreshNonUpdateableReferences(); | |
63 | ||
64 | /** | |
65 | * This method is used to refresh a reference object that hangs off of a document. For example, if the attribute's keys were | |
66 | * updated for a reference object, but the reference object wasn't, this method would go out and retrieve the reference object. | |
67 | * | |
68 | * @param referenceObjectName | |
69 | */ | |
70 | public abstract void refreshReferenceObject(String referenceObjectName); | |
71 | ||
72 | /** | |
73 | * If this method is not implemented appropriately for PersistableBusinessObject with collections, then PersistableBusinessObject with collections will not persist deletions correctly. | |
74 | * Elements that have been deleted will reappear in the DB after retrieval. | |
75 | * | |
76 | * @return List of collections which need to be monitored for changes by OJB | |
77 | */ | |
78 | public List buildListOfDeletionAwareLists(); | |
79 | ||
80 | /** | |
81 | * Returns the boolean indicating whether this record is a new record of a maintenance document collection. | |
82 | * Used to determine whether the record can be deleted on the document. | |
83 | */ | |
84 | public boolean isNewCollectionRecord(); | |
85 | ||
86 | /** | |
87 | * Sets the boolean indicating this record is a new record of a maintenance document collection. | |
88 | * Used to determine whether the record can be deleted on the document. | |
89 | */ | |
90 | public void setNewCollectionRecord(boolean isNewCollectionRecord); | |
91 | ||
92 | /** | |
93 | * Hook to link in any editable user fields. | |
94 | */ | |
95 | public void linkEditableUserFields(); | |
96 | ||
97 | public Note getBoNote(int nbr); | |
98 | ||
99 | public boolean addNote(Note note); | |
100 | ||
101 | public boolean deleteNote(Note note); | |
102 | ||
103 | public PersistableBusinessObjectExtension getExtension(); | |
104 | public void setExtension(PersistableBusinessObjectExtension extension); | |
105 | public void setAutoIncrementSet(boolean autoIncrementSet); | |
106 | } |