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 * Thrown by the persistence provider when an entity reference obtained by
014 * {@link EntityManager#getReference EntityManager.getReference}
015 * is accessed but the entity does not exist. Thrown when
016 * {@link EntityManager#refresh EntityManager.refresh} is called and the
017 * object no longer exists in the database.
018 * Thrown when {@link EntityManager#lock EntityManager.lock} is used with
019 * pessimistic locking is used and the entity no longer exists in the database.
020 * <p> The current transaction, if one is active, will be marked for rollback.
021 *
022 * @see EntityManager#getReference(Class, Object)
023 * @see EntityManager#refresh(Object)
024 * @see EntityManager#refresh(Object, LockModeType)
025 * @see EntityManager#refresh(Object, java.util.Map)
026 * @see EntityManager#refresh(Object, LockModeType, java.util.Map)
027 * @see EntityManager#lock(Object, LockModeType)
028 * @see EntityManager#lock(Object, LockModeType, java.util.Map)
029 * @since Java Persistence 1.0
030 */
031public class EntityNotFoundException extends PersistenceException {
032
033  /**
034   * Constructs a new <code>EntityNotFoundException</code> exception with
035   * <code>null</code> as its detail message.
036   */
037  public EntityNotFoundException() {
038    super();
039  }
040
041  /**
042   * Constructs a new <code>EntityNotFoundException</code> exception with the
043   * specified detail message.
044   *
045   * @param message the detail message.
046   */
047  public EntityNotFoundException(String message) {
048    super(message);
049  }
050
051}