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 a database sequence.
023   */
024  SEQUENCE,
025
026  /**
027   * Indicates that the persistence provider must assign
028   * primary keys for the entity using a database identity column.
029   */
030  IDENTITY,
031
032  /**
033   * Indicates that the persistence provider should pick an
034   * appropriate strategy for the particular database. The
035   * <code>AUTO</code> generation strategy may expect a database
036   * resource to exist, or it may attempt to create one. A vendor
037   * may provide documentation on how to create such resources
038   * in the event that it does not support schema generation
039   * or cannot create the schema resource at runtime.
040   */
041  AUTO
042}