001/* 002 * Copyright (c) 2008, 2009, 2011 Oracle, Inc. All rights reserved. 003 * 004 * This program and the accompanying materials are made available under the 005 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 006 * which accompanies this distribution. The Eclipse Public License is available 007 * at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License 008 * is available at http://www.eclipse.org/org/documents/edl-v10.php. 009 */ 010package javax.persistence; 011 012import java.lang.annotation.Retention; 013import java.lang.annotation.Target; 014 015import static java.lang.annotation.ElementType.FIELD; 016import static java.lang.annotation.RetentionPolicy.RUNTIME; 017 018/** 019 * Specifies that a persistent property or field should be persisted 020 * as a large object to a database-supported large object type. 021 * <p> 022 * <p> Portable applications should use the <code>Lob</code> annotation 023 * when mapping to a database Lob type. The <code>Lob</code> 024 * annotation may be used in conjunction with the {@link Basic} 025 * annotation or the {@link ElementCollection} annotation when the 026 * element collection value is of basic type. A <code>Lob</code> may 027 * be either a binary or character type. 028 * <p> 029 * <p> The <code>Lob</code> type is inferred from the type of the 030 * persistent field or property, and except for string and 031 * character-based types defaults to Blob. 032 * <pre> 033 * 034 * Example 1: 035 * 036 * @Lob @Basic(fetch=LAZY) 037 * @Column(name="REPORT") 038 * protected String report; 039 * 040 * Example 2: 041 * 042 * @Lob @Basic(fetch=LAZY) 043 * @Column(name="EMP_PIC", columnDefinition="BLOB NOT NULL") 044 * protected byte[] pic; 045 * 046 * </pre> 047 * 048 * @see Basic 049 * @see ElementCollection 050 * @since Java Persistence 1.0 051 */ 052@Target({FIELD}) 053@Retention(RUNTIME) 054public @interface Lob { 055}