Embeddable (Java EE 5)

Java EE API


javax.persistence Annotation Type Embeddable


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Embeddable

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

定义符合以下条件的类:其实例存储为拥有实体的内在部分,并共享实体身份。嵌入对象的各个持久属性或字段都映射到实体的数据库表格。只有 BasicColumnLobTemporalEnumerated 映射注释能够以可移植的方式映射注释为 Embeddable 的类的持久字段或属性。

注意,Transient 注释可以用于指定可嵌入类的非持久状态。

英文文档:

Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity. Each of the persistent properties or fields of the embedded object is mapped to the database table for the entity. Only Basic, Column, Lob, Temporal, and Enumerated mapping annotations may portably be used to map the persistent fields or properties of classes annotated as Embeddable.

Note that the Transient annotation may be used to designate the non-persistent state of an embeddable class.

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