View Javadoc

1   /*
2    * Copyright 2006-2008 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.exception;
17  
18  import org.kuali.rice.kns.bo.PersistableBusinessObject;
19  
20  /**
21   * This class represents a situation where a business object is specified for lookup or loading, but it does not exist in the
22   * database.
23   * 
24   * This exception can be used for when that is a fatal error.
25   * 
26   * 
27   */
28  public class BusinessObjectNotFoundException extends RuntimeException {
29  
30      /**
31       * Constructs a BusinessObjectNotFoundException.java.
32       */
33      public BusinessObjectNotFoundException() {
34          super();
35      }
36  
37      /**
38       * Constructs a BusinessObjectNotFoundException.java.
39       * 
40       * @param message
41       */
42      public BusinessObjectNotFoundException(String message) {
43          super(message);
44      }
45  
46      /**
47       * Constructs a BusinessObjectNotFoundException.java.
48       * 
49       * @param message
50       * @param cause
51       */
52      public BusinessObjectNotFoundException(String message, Throwable cause) {
53          super(message, cause);
54      }
55  
56      /**
57       * Constructs a BusinessObjectNotFoundException.java.
58       * 
59       * @param cause
60       */
61      public BusinessObjectNotFoundException(Throwable cause) {
62          super(cause);
63      }
64  
65      /**
66       * 
67       * Constructs a BusinessObjectNotFoundException.java.
68       * 
69       * @param bo - the business object specified which cannot be found in the database
70       * @param message - the message to pass up
71       */
72      public BusinessObjectNotFoundException(PersistableBusinessObject bo, String message) {
73          super("BO Not Found: [" + bo.getClass().getName() + "] " + bo.toString() + ".  " + message);
74      }
75  
76      /**
77       * 
78       * Constructs a BusinessObjectNotFoundException.java.
79       * 
80       * @param bo - the business object specified which cannot be found in the database
81       */
82      public BusinessObjectNotFoundException(PersistableBusinessObject bo) {
83          super("BO Not Found: [" + bo.getClass().getName() + "] " + bo.toString() + ".");
84      }
85  
86  }