Top Description Fields Constructors Methods
jakarta.persistence

public final Enum GenerationType

extends Enum<GenerationType>
Class Inheritance

Enumerates the defined primary key generation strategies.
Since
1.0
See Also
GeneratedValue

Field Summary

Modifier and TypeField and Description
public static final GenerationType
AUTO

Indicates that the persistence provider should pick an appropriate strategy for the particular database.

public static final GenerationType
IDENTITY

Indicates that the persistence provider must assign primary keys for the entity using a database identity column.

public static final GenerationType
SEQUENCE

Indicates that the persistence provider must assign primary keys for the entity using a database sequence.

public static final GenerationType
TABLE

Indicates that the persistence provider must assign primary keys for the entity using an underlying database table to ensure uniqueness.

public static final GenerationType
UUID

Indicates that the persistence provider must assign primary keys for the entity by generating an RFC 4122 Universally Unique IDentifier.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static GenerationType
public static GenerationType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AUTOback to summary
public static final GenerationType AUTO

Indicates that the persistence provider should pick an appropriate strategy for the particular database.

The AUTO generation strategy may expect a database resource to exist, or it may attempt to create one. A vendor may provide documentation on how to create such resources in the event that it does not support schema generation or cannot create the schema resource at runtime.

IDENTITYback to summary
public static final GenerationType IDENTITY

Indicates that the persistence provider must assign primary keys for the entity using a database identity column.

May be used to generate primary keys of type Long, Integer, long, or int.

SEQUENCEback to summary
public static final GenerationType SEQUENCE

Indicates that the persistence provider must assign primary keys for the entity using a database sequence.

May be used to generate primary keys of type Long, Integer, long, or int.

TABLEback to summary
public static final GenerationType TABLE

Indicates that the persistence provider must assign primary keys for the entity using an underlying database table to ensure uniqueness.

May be used to generate primary keys of type Long, Integer, long, or int.

UUIDback to summary
public static final GenerationType UUID

Indicates that the persistence provider must assign primary keys for the entity by generating an RFC 4122 Universally Unique IDentifier.

May be used to generate primary keys of type java.util.UUID or String.

Constructor Detail

GenerationTypeback to summary
private GenerationType()

Method Detail

valueOfback to summary
public static GenerationType valueOf(String name)
valuesback to summary
public static GenerationType[] values()