01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.bo;
17:
18: import java.util.List;
19:
20: /**
21: *
22: * This is a marker interface used to determine whether we are dealing with a GlobalBusinessObject or something else
23: *
24: * If implementations of this class implement {@link PersistableBusinessObject} as well, then it is strongly recommended that
25: * classes override {@link PersistableBusinessObject#buildListOfDeletionAwareLists()} as well. If this is not done correctly, then
26: * deleted collection elements will not be persisted, and upon reload from the DB, the deleted items will appear in the collection.
27: */
28: public interface GlobalBusinessObject {
29:
30: /**
31: * Gets the documentNumber attribute.
32: *
33: * @return Returns the documentNumber
34: *
35: */
36: public String getDocumentNumber();
37:
38: /**
39: * Sets the documentNumber attribute.
40: *
41: * @param documentNumber The documentNumber to set.
42: *
43: */
44: public void setDocumentNumber(String documentNumber);
45:
46: /**
47: *
48: * This method applies the global changed fields to the list of BOs contained within, and returns the list, with all the
49: * relevant values updated.
50: *
51: * @return Returns a List of BusinessObjects that are ready for persisting, with any relevant values changed
52: *
53: */
54: public List<PersistableBusinessObject> generateGlobalChangesToPersist();
55:
56: /**
57: *
58: * This method generates a list of BusinessObjects that need to be deleted as part of the final processing for a global
59: * maintenance document. These records should be deleted before the records from getGlobalChangesToPersist() are persisted.
60: *
61: * @return A List of BusinessObjects that should be deleted as part of this global maint doc's final processing.
62: *
63: */
64: public List<PersistableBusinessObject> generateDeactivationsToPersist();
65:
66: /**
67: *
68: * This method examines the underlying document and determines whether it can be persisted as part of the enclosing
69: * MaintenanceDocument. If it returns false, then the Maintenance Document it is part of should not be saved, as a SQL Exception
70: * is likely to result.
71: *
72: * @return True if the document can be safely persisted, False if not.
73: *
74: */
75: public boolean isPersistable();
76:
77: /**
78: * Returns a list of all global detail objects on this document. This method needs to return all detail
79: * objects, even if they are of different types.
80: *
81: * @return
82: */
83: public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects();
84: }
|