1 /*
2 * Copyright (c) 2008, 2019 Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0 which is available at
6 * http://www.eclipse.org/legal/epl-2.0,
7 * or the Eclipse Distribution License v. 1.0 which is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11 */
12
13 // Contributors:
14 // Linda DeMichiel - 2.1
15 // Linda DeMichiel - 2.0
16
17 package javax.persistence;
18
19 /**
20 * Defines the types of primary key generation strategies.
21 *
22 * @see GeneratedValue
23 *
24 * @since 1.0
25 */
26 public enum GenerationType {
27
28 /**
29 * Indicates that the persistence provider must assign
30 * primary keys for the entity using an underlying
31 * database table to ensure uniqueness.
32 */
33 TABLE,
34
35 /**
36 * Indicates that the persistence provider must assign
37 * primary keys for the entity using a database sequence.
38 */
39 SEQUENCE,
40
41 /**
42 * Indicates that the persistence provider must assign
43 * primary keys for the entity using a database identity column.
44 */
45 IDENTITY,
46
47 /**
48 * Indicates that the persistence provider should pick an
49 * appropriate strategy for the particular database. The
50 * <code>AUTO</code> generation strategy may expect a database
51 * resource to exist, or it may attempt to create one. A vendor
52 * may provide documentation on how to create such resources
53 * in the event that it does not support schema generation
54 * or cannot create the schema resource at runtime.
55 */
56 AUTO
57 }
58