Annotation Interface SequenceGenerator
Specifies a sequence generator for generating values for annotated fields marked with
GeneratedValue
using the GenerationType.SEQUENCE
strategy.
This annotation is typically applied to a field, method, or class within a Java class that represents an entity in a data store.
The name
attribute defines the name of the generator, while the sequenceName
attribute specifies
the name of the database sequence to be used. The initialValue
and allocationSize
attributes allow
customization of the initial value and the increment size of the sequence, respectively.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionSpecifies the name of the sequence generator.Specifies the name of the database sequence to be used. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
Specifies the size of the allocation block for the sequence.int
Specifies the initial value for the sequence.
-
Element Details
-
name
String nameSpecifies the name of the sequence generator.- Returns:
- The name of the sequence generator.
-
sequenceName
String sequenceNameSpecifies the name of the database sequence to be used.- Returns:
- The name of the database sequence.
-
initialValue
int initialValueSpecifies the initial value for the sequence. The default is 1.- Returns:
- The initial value for the sequence.
- Default:
1
-
allocationSize
int allocationSizeSpecifies the size of the allocation block for the sequence. The default is 50.- Returns:
- The allocation size for the sequence.
- Default:
50
-