1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the "License"). You may not use this file except 5 * in compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * glassfish/bootstrap/legal/CDDLv1.0.txt or 9 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * HEADER in each file and include the License file at 15 * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 16 * add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your 18 * own identifying information: Portions Copyright [yyyy] 19 * [name of copyright owner] 20 */ 21 // Copyright (c) 1998, 2005, Oracle. All rights reserved. 22 23 /* Copyright (c) 2004, 2005, Oracle. All rights reserved. */ 24 /* 25 DESCRIPTION 26 <short description of component this file declares/defines> 27 28 PRIVATE CLASSES 29 <list of private classes defined - with one-line descriptions> 30 31 NOTES 32 <other useful comments, qualifications, etc.> 33 34 MODIFIED (MM/DD/YY) 35 pkrogh 10/07/05 - 36 pkrogh 09/29/05 - 37 gyorke 08/09/05 - gyorke_10-essentials-directory-creation_050808 38 dmahar 08/04/05 - 39 pkrogh 08/28/04 - codeformat 40 smcritch 05/14/04 - smcritch_refactor_session_read031604 41 smcritch 04/26/04 - Creation 42 */ 43 package oracle.toplink.essentials.internal.helper; 44 45 46 /** 47 * <b>Purpose</b>:Indicates an object that should not be returned from 48 * query execution. 49 * <p> 50 * When conforming if checkEarly return finds a matching object by exact primary 51 * key, but that object is deleted, want to return null from query execution. 52 * <p> 53 * However if null is returned from checkEarly return that will indicate that 54 * no object was found and to go to the database. Hence returning null is not 55 * enough, something else needed to be returned, indicating not only that 56 * checkEarlyReturn had failed but query execution should not proceed. 57 * <p> 58 * Can be used in other instances where returning null is ambiguous. 59 * <p> 60 * Implements singleton pattern 61 * @author Stephen McRitchie 62 * @since release specific (what release of product did this appear in) 63 */ 64 public class InvalidObject { 65 public static final InvalidObject instance = new InvalidObject(); 66 67 private InvalidObject() { 68 } 69 70 /** 71 * @return singleton invalid object. 72 */ 73 public static InvalidObject instance() { 74 return instance; 75 } 76 } 77