01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * // Copyright (c) 1998, 2007, Oracle. All rights reserved.
05: * // Copyright (c) 2004, 2006, Oracle. All rights reserved.
06: *
07: *
08: * The contents of this file are subject to the terms of either the GNU
09: * General Public License Version 2 only ("GPL") or the Common Development
10: * and Distribution License("CDDL") (collectively, the "License"). You
11: * may not use this file except in compliance with the License. You can obtain
12: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
13: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
14: * language governing permissions and limitations under the License.
15: *
16: * When distributing the software, include this License Header Notice in each
17: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
18: * Sun designates this particular file as subject to the "Classpath" exception
19: * as provided by Sun in the GPL Version 2 section of the License file that
20: * accompanied this code. If applicable, add the following below the License
21: * Header, with the fields enclosed by brackets [] replaced by your own
22: * identifying information: "Portions Copyrighted [year]
23: * [name of copyright owner]"
24: *
25: * Contributor(s):
26: *
27: * If you wish your version of this file to be governed by only the CDDL or
28: * only the GPL Version 2, indicate your decision by adding "[Contributor]
29: * elects to include this software in this distribution under the [CDDL or GPL
30: * Version 2] license." If you don't indicate a single choice of license, a
31: * recipient has the option to distribute your version of this file under
32: * either the CDDL, the GPL Version 2 or to extend the choice of license to
33: * its licensees as provided above. However, if you add GPL Version 2 code
34: * and therefore, elected the GPL Version 2 license, then the option applies
35: * only if the new code is made subject to such option by the copyright
36: * holder.
37: */
38:
39: /*
40: DESCRIPTION
41: <short description of component this file declares/defines>
42:
43: PRIVATE CLASSES
44: <list of private classes defined - with one-line descriptions>
45:
46: NOTES
47: <other useful comments, qualifications, etc.>
48:
49: MODIFIED (MM/DD/YY)
50: pkrogh 10/07/05 -
51: pkrogh 09/29/05 -
52: gyorke 08/09/05 - gyorke_10-essentials-directory-creation_050808
53: dmahar 08/04/05 -
54: pkrogh 08/28/04 - codeformat
55: smcritch 05/14/04 - smcritch_refactor_session_read031604
56: smcritch 04/26/04 - Creation
57: */
58: package oracle.toplink.essentials.internal.helper;
59:
60: /**
61: * <b>Purpose</b>:Indicates an object that should not be returned from
62: * query execution.
63: * <p>
64: * When conforming if checkEarly return finds a matching object by exact primary
65: * key, but that object is deleted, want to return null from query execution.
66: * <p>
67: * However if null is returned from checkEarly return that will indicate that
68: * no object was found and to go to the database. Hence returning null is not
69: * enough, something else needed to be returned, indicating not only that
70: * checkEarlyReturn had failed but query execution should not proceed.
71: * <p>
72: * Can be used in other instances where returning null is ambiguous.
73: * <p>
74: * Implements singleton pattern
75: * @author Stephen McRitchie
76: * @since release specific (what release of product did this appear in)
77: */
78: public class InvalidObject {
79: public static final InvalidObject instance = new InvalidObject();
80:
81: private InvalidObject() {
82: }
83:
84: /**
85: * @return singleton invalid object.
86: */
87: public static InvalidObject instance() {
88: return instance;
89: }
90: }
|