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 * Used as the value of the
014 * <code>javax.persistence.cache.storeMode</code> property to specify
015 * the behavior when data is read from the database and when data is
016 * committed into the database.
017 *
018 * @since Java Persistence 2.0
019 */
020public enum CacheStoreMode {
021
022  /**
023   * Insert/update entity data into cache when read
024   * from database and when committed into database:
025   * this is the default behavior. Does not force refresh
026   * of already cached items when reading from database.
027   */
028  USE,
029
030  /**
031   * Don't insert into cache.
032   */
033  BYPASS,
034
035  /**
036   * Insert/update entity data into cache when read
037   * from database and when committed into database.
038   * Forces refresh of cache for items read from database.
039   */
040  REFRESH
041}