@Target(value={TYPE,METHOD,FIELD}) @Retention(value=RUNTIME) public @interface SequenceGenerator
GeneratedValue annotation. A sequence generator
may be specified on the entity class or on the primary key
field or property. The scope of the generator name is global
to the persistence unit (across all generator types).
Example: @SequenceGenerator(name="EMP_SEQ", allocationSize=25)
| 限定符和类型 | 必需的元素和说明 |
|---|---|
String |
name
(Required) A unique generator name that can be referenced
by one or more classes to be the generator for primary key
values.
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
int |
allocationSize
(Optional) The amount to increment by when allocating
sequence numbers from the sequence.
|
int |
initialValue
(Optional) The value from which the sequence object
is to start generating.
|
String |
sequenceName
(Optional) The name of the database sequence object from
which to obtain primary key values.
|
public abstract String name
public abstract String sequenceName
Defaults to a provider-chosen value.
Copyright © 2016. All rights reserved.