@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface SequenceGenerator
The annotated field must be a member of an Entity annotated class. This annotation
must be used in conjunction with the Id annotation and the GeneratedValue
annotation.
@Entity
public class Employee {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@SequenceGenerator(sequence = "EMPLOYEE_SEQ")
Integer id;
...
}
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
sequence |
| Modifier and Type | Optional Element and Description |
|---|---|
long |
allocationSize |
java.lang.String |
catalog |
java.lang.Class<? extends SequenceIdGenerator> |
implementer |
long |
initialValue |
java.lang.String |
schema |
public abstract java.lang.Class<? extends SequenceIdGenerator> implementer
SequenceIdGenerator interface.