Lob (Java EE 5)

Java EE API


javax.persistence Annotation Type Lob


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Lob

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

指定应该作为大对象到支持数据库的大对象类型保留的持久属性或字段。Lob 注释可以与 Basic 注释一起使用。Lob 可以是二进制或字符类型。

Lob 类型是根据持久字段或属性推断的,但字符串和基于字符的类型默认为 Blob。

示例:

   @Lob @Basic(fetch=LAZY)
   @Column(name="REPORT")
   protected String report;
 
英文文档:

Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type. The Lob annotation may be used in conjunction with the Basic annotation. A Lob may be either a binary or character type.

The Lob type is inferred from the type of the persistent field or property, and except for string and character-based types defaults to Blob.

   Example:

   @Lob @Basic(fetch=LAZY)
   @Column(name="REPORT")
   protected String report;
 

Since:
Java Persistence 1.0



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!