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 a problem occurs.
014 * All instances of <code>PersistenceException</code> except for instances of
015 * {@link NoResultException}, {@link NonUniqueResultException},
016 * {@link LockTimeoutException}, and {@link QueryTimeoutException} will cause
017 * the current transaction, if one is active, to be marked for rollback.
018 *
019 * @since Java Persistence 1.0
020 */
021public class PersistenceException extends RuntimeException {
022  /**
023   * Constructs a new <code>PersistenceException</code> exception
024   * with <code>null</code> as its detail message.
025   */
026  public PersistenceException() {
027    super();
028  }
029
030  /**
031   * Constructs a new <code>PersistenceException</code> exception
032   * with the specified detail message.
033   *
034   * @param message the detail message.
035   */
036  public PersistenceException(String message) {
037    super(message);
038  }
039
040  /**
041   * Constructs a new <code>PersistenceException</code> exception
042   * with the specified detail message and cause.
043   *
044   * @param message the detail message.
045   * @param cause   the cause.
046   */
047  public PersistenceException(String message, Throwable cause) {
048    super(message, cause);
049  }
050
051  /**
052   * Constructs a new <code>PersistenceException</code> exception
053   * with the specified cause.
054   *
055   * @param cause the cause.
056   */
057  public PersistenceException(Throwable cause) {
058    super(cause);
059  }
060}