About SequenceGenerator

1-10 of 26Refresh
Manual
95

Auto Generated Values

and using the named sequence in one or more fields in one or more classes. The @SequenceGenerator ... a sequence - might also be in another class: @SequenceGenerator(name="seq", initialValue=1, allocationSize ... sequence numbers to start with 1 in the TABLE strategy initialValue=0 has to be specified in the @SequenceGenerator annotation.
JPA Doc
77

javax.persistence.SequenceGenerator

javax.persistence Annotation SequenceGenerator Target: Classes and fields (including property get methods) Defines a primary key generator that may be referenced by name when a generator element ... to the persistence unit (across all generator types). Example: @SequenceGenerator(name="EMP_SEQ
JPA Doc
74

SequenceGenerator.allocationSize

Annotation Element javax.persistence.SequenceGenerator int allocationSize (Optional) The amount to increment by when allocating sequence numbers from the sequence. Default value: 50 Since: JPA 1.0
JPA Doc
74

SequenceGenerator.catalog

Annotation Element javax.persistence.SequenceGenerator String catalog (Optional) The catalog of the sequence generator. Default value: "" Since: JPA 2.0
JPA Doc
74

SequenceGenerator.initialValue

Annotation Element javax.persistence.SequenceGenerator int initialValue (Optional) The value from which the sequence object is to start generating. Default value: 1 Since: JPA 1.0
JPA Doc
74

SequenceGenerator.name

Annotation Element javax.persistence.SequenceGenerator String name (Required) A unique generator name that can be referenced by one or more classes to be the generator for primary key values. Since: JPA 1.0
JPA Doc
74

SequenceGenerator.schema

Annotation Element javax.persistence.SequenceGenerator String schema (Optional) The schema of the sequence generator. Default value: "" Since: JPA 2.0
JPA Doc
74

SequenceGenerator.sequenceName

Annotation Element javax.persistence.SequenceGenerator String sequenceName (Optional) The name of the database sequence object from which to obtain primary key values. Defaults to a provider-chosen value. Default value: "" Since: JPA 1.0
JPA Doc
55

JPA Annotations for Value Generation

Reference (JavaDoc) of JPA 2 value generation annotations, including @GeneratedValue, @SequenceGenerator and @TableGenerator.
Forum
27

@SequenceGenerator and single id in whole database

Hi, I have a question about @SequenceGenerator. I have separate @SequenceGenerator in each ... @SequenceGenerator and/or @TableGenerator definitions (with different name values), and attaching ... class got following annotations: @SequenceGenerator(name = "XXX", sequenceName = "Seq_XXX