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 * Specifies how the provider must use a second-level cache for the persistence unit. Corresponds to the value
014 * of the <code>persistence.xml</code> <code>shared-cache-mode</code> element, and returned as the result of
015 * {@link javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()}.
016 *
017 * @since Java Persistence 2.0
018 */
019public enum SharedCacheMode {
020  /**
021   * All entities and entity-related state and data are cached.
022   */
023  ALL,
024
025  /**
026   * Caching is disabled for the persistence unit.
027   */
028  NONE,
029
030  /**
031   * Caching is enabled for all entities for <code>Cacheable(true)</code> is specified. All other entities
032   * are not cached.
033   */
034  ENABLE_SELECTIVE,
035
036  /**
037   * Caching is enabled for all entities except those for which <code>Cacheable(false)</code> is specified.
038   * Entities for which <code>Cacheable(false)</code> is specified are not cached.
039   */
040  DISABLE_SELECTIVE,
041
042  /**
043   * Caching behavior is undefined: provider-specific defaults may apply.
044   */
045  UNSPECIFIED
046}