|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
javax.persistence Annotation Type Table
Implements:
Annotation
@Target(value=TYPE)@Retention(value=RUNTIME)
此注释为注释的实体指定主表格。使用
SecondaryTable
或 SecondaryTables
注释可以指定其他表格。
如果没有为实体类指定 Table
注释,则应用默认值。
示例: @Entity @Table(name="CUST", schema="RECORDS") public class Customer { ... }
since |
|
This annotation specifies the primary table for the annotated
entity. Additional tables may be specified using SecondaryTable
or SecondaryTables
annotation.
If no Table
annotation is specified for an entity
class, the default values apply.
Example: @Entity @Table(name="CUST", schema="RECORDS") public class Customer { ... }
- Since:
- Java Persistence 1.0
Optional Element Summary | |
---|---|
String |
catalog
(Optional) The catalog of the table. |
String |
name
(Optional) The name of the table. |
String |
schema
(Optional) The schema of the table. |
UniqueConstraint[] |
uniqueConstraints
(Optional) Unique constraints that are to be placed on the table. |
abstract public String
name()
(可选)表格的名称。
默认为实体名称。
name
public abstract String name
- (Optional) The name of the table.
Defaults to the entity name.
- Default:
- ""
abstract public String
catalog()
(可选)表格种类。
默认为默认种类。
catalog
public abstract String catalog
- (Optional) The catalog of the table.
Defaults to the default catalog.
- Default:
- ""
abstract public String
schema()
(可选)表格模式。
默认为用户的默认模式。
schema
public abstract String schema
- (Optional) The schema of the table.
Defaults to the default schema for user.
- Default:
- ""
abstract public UniqueConstraint[]
uniqueConstraints()
(可选)对表格设置的唯一约束。仅当表格生成生效时使用。除了应用 Column
和 JoinColumn
注释中指定的约束条件和主键映射引起的约束条件外,还应用这些约束条件。
默认为无额外限制。
uniqueConstraints
public abstract UniqueConstraint[] uniqueConstraints
- (Optional) Unique constraints that are to be placed on
the table. These are only used if table generation is in
effect. These constraints apply in addition to any constraints
specified by the
Column
andJoinColumn
annotations and constraints entailed by primary key mappings.Defaults to no additional constraints.
- Default:
- {}
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!