001/* 002 * Copyright (c) 2008, 2009, 2011 Oracle, Inc. All rights reserved. 003 * 004 * This program and the accompanying materials are made available under the 005 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 006 * which accompanies this distribution. The Eclipse Public License is available 007 * at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License 008 * is available at http://www.eclipse.org/org/documents/edl-v10.php. 009 */ 010package javax.persistence; 011 012/** 013 * Defines the types of primary key generation strategies. 014 * 015 * @see GeneratedValue 016 * @since Java Persistence 1.0 017 */ 018public enum GenerationType { 019 020 /** 021 * Indicates that the persistence provider must assign 022 * primary keys for the entity using an underlying 023 * database table to ensure uniqueness. 024 */ 025 TABLE, 026 027 /** 028 * Indicates that the persistence provider must assign 029 * primary keys for the entity using a database sequence. 030 */ 031 SEQUENCE, 032 033 /** 034 * Indicates that the persistence provider must assign 035 * primary keys for the entity using a database identity column. 036 */ 037 IDENTITY, 038 039 /** 040 * Indicates that the persistence provider should pick an 041 * appropriate strategy for the particular database. The 042 * <code>AUTO</code> generation strategy may expect a database 043 * resource to exist, or it may attempt to create one. A vendor 044 * may provide documentation on how to create such resources 045 * in the event that it does not support schema generation 046 * or cannot create the schema resource at runtime. 047 */ 048 AUTO 049}