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  * Specifies how the provider must use a second-level cache for the
21  * persistence unit.  Corresponds to the value of the <code>persistence.xml</code>
22  * <code>shared-cache-mode</code> element, and returned as the result of
23  * {@link javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()}.
24  * 
25  * @since 2.0
26  */

27 public enum SharedCacheMode {
28
29     /**
30      * All entities and entity-related state and data are cached.
31      */

32     ALL, 
33
34     /**
35      * Caching is disabled for the persistence unit.
36      */

37     NONE, 
38
39     /**
40      * Caching is enabled for all entities for <code>Cacheable(true)</code>
41      * is specified.  All other entities are not cached.
42      */

43     ENABLE_SELECTIVE, 
44
45     /**
46      * Caching is enabled for all entities except those for which
47      * <code>Cacheable(false)</code> is specified.  Entities for which
48      * <code>Cacheable(false)</code> is specified are not cached.
49      */

50     DISABLE_SELECTIVE, 
51
52     /**
53      * 
54      * Caching behavior is undefined: provider-specific defaults may apply.
55      */

56     UNSPECIFIED
57 }
58