001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krad.bo; 017 018import java.util.List; 019 020 021/** 022 * 023 * This is a marker interface used to determine whether we are dealing with a GlobalBusinessObject or something else 024 * 025 * If implementations of this class implement {@link PersistableBusinessObject} as well, then it is strongly recommended that 026 * classes override {@link PersistableBusinessObject#buildListOfDeletionAwareLists()} as well. If this is not done correctly, then 027 * deleted collection elements will not be persisted, and upon reload from the DB, the deleted items will appear in the collection. 028 */ 029public interface GlobalBusinessObject { 030 031 /** 032 * Gets the documentNumber attribute. 033 * 034 * @return Returns the documentNumber 035 * 036 */ 037 public String getDocumentNumber(); 038 039 /** 040 * Sets the documentNumber attribute. 041 * 042 * @param documentNumber The documentNumber to set. 043 * 044 */ 045 public void setDocumentNumber(String documentNumber); 046 047 /** 048 * 049 * This method applies the global changed fields to the list of BOs contained within, and returns the list, with all the 050 * relevant values updated. 051 * 052 * @return Returns a List of BusinessObjects that are ready for persisting, with any relevant values changed 053 * 054 */ 055 public List<PersistableBusinessObject> generateGlobalChangesToPersist(); 056 057 /** 058 * 059 * This method generates a list of BusinessObjects that need to be deleted as part of the final processing for a global 060 * maintenance document. These records should be deleted before the records from getGlobalChangesToPersist() are persisted. 061 * 062 * @return A List of BusinessObjects that should be deleted as part of this global maint doc's final processing. 063 * 064 */ 065 public List<PersistableBusinessObject> generateDeactivationsToPersist(); 066 067 /** 068 * 069 * This method examines the underlying document and determines whether it can be persisted as part of the enclosing 070 * MaintenanceDocument. If it returns false, then the Maintenance Document it is part of should not be saved, as a SQL Exception 071 * is likely to result. 072 * 073 * @return True if the document can be safely persisted, False if not. 074 * 075 */ 076 public boolean isPersistable(); 077 078 /** 079 * Returns a list of all global detail objects on this document. This method needs to return all detail 080 * objects, even if they are of different types. 081 * 082 * @return 083 */ 084 public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects(); 085}