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.kns.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 * 029 * @deprecated use BulkUpdate instead 030 */ 031@Deprecated 032public interface GlobalBusinessObject { 033 034 /** 035 * Gets the documentNumber attribute. 036 * 037 * @return Returns the documentNumber 038 * 039 */ 040 public String getDocumentNumber(); 041 042 /** 043 * Sets the documentNumber attribute. 044 * 045 * @param documentNumber The documentNumber to set. 046 * 047 */ 048 public void setDocumentNumber(String documentNumber); 049 050 /** 051 * 052 * This method applies the global changed fields to the list of BOs contained within, and returns the list, with all the 053 * relevant values updated. 054 * 055 * @return Returns a List of BusinessObjects that are ready for persisting, with any relevant values changed 056 * 057 */ 058 public List generateGlobalChangesToPersist(); 059 060 /** 061 * 062 * This method generates a list of BusinessObjects that need to be deleted as part of the final processing for a global 063 * maintenance document. These records should be deleted before the records from getGlobalChangesToPersist() are persisted. 064 * 065 * @return A List of BusinessObjects that should be deleted as part of this global maint doc's final processing. 066 * 067 */ 068 public List generateDeactivationsToPersist(); 069 070 /** 071 * 072 * This method examines the underlying document and determines whether it can be persisted as part of the enclosing 073 * MaintenanceDocument. If it returns false, then the Maintenance Document it is part of should not be saved, as a SQL Exception 074 * is likely to result. 075 * 076 * @return True if the document can be safely persisted, False if not. 077 * 078 */ 079 public boolean isPersistable(); 080 081 /** 082 * Returns a list of all global detail objects on this document. This method needs to return all detail 083 * objects, even if they are of different types. 084 * 085 * @return 086 */ 087 public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects(); 088}