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 in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 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 Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 package javax.persistence; 24 25 /** 26 * Defines strategies for fetching data from the database. 27 * The <code>EAGER</code> strategy is a requirement on the persistence 28 * provider runtime that data must be eagerly fetched. The 29 * <code>LAZY</code> strategy is a hint to the persistence provider 30 * runtime that data should be fetched lazily when it is 31 * first accessed. The implementation is permitted to eagerly 32 * fetch data for which the <code>LAZY</code> strategy hint has been 33 * specified. In particular, lazy fetching might only be 34 * available for {@link Basic} mappings for which property-based 35 * access is used. 36 * 37 * <pre> 38 * Example: 39 * @Basic(fetch=LAZY) 40 * protected String getName() { return name; } 41 * </pre> 42 * 43 * @since Java Persistence 1.0 44 */ 45 public enum FetchType { 46 47 /** Defines that data can be lazily fetched */ 48 LAZY, 49 50 /** Defines that data must be eagerly fetched */ 51 EAGER 52 } 53