Entity (Java EE 5)

Java EE API


javax.persistence Annotation Type Entity


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

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

指定类是一个实体。此注释应用于实体类。
英文文档:

Specifies that the class is an entity. This annotation is applied to the entity class.

Since:
Java Persistence 1.0

Optional Element Summary
 String
 

abstract public String name()
实体名称。默认为实体类的非限定名称。此名称用于引用查询中的实体。此名称不得为 Java Persistence 查询语言中的保留字面值。
英文文档:

name

public abstract String name
The name of an entity. Defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal in the Java Persistence query language.

Default:
""


Submit a bug or feature

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

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

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