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 {@link
014 * Query#getSingleResult Query.getSingleResult()} or {@link
015 * TypedQuery#getSingleResult TypedQuery.getSingleResult()} is executed on a
016 * query and there is more than one result from the query. This
017 * exception will not cause the current transaction, if one is active,
018 * to be marked for rollback.
019 *
020 * @see Query#getSingleResult()
021 * @see TypedQuery#getSingleResult()
022 * @since Java Persistence 1.0
023 */
024public class NonUniqueResultException extends PersistenceException {
025
026  /**
027   * Constructs a new <code>NonUniqueResultException</code> exception
028   * with <code>null</code> as its detail message.
029   */
030  public NonUniqueResultException() {
031    super();
032  }
033
034  /**
035   * Constructs a new <code>NonUniqueResultException</code> exception
036   * with the specified detail message.
037   *
038   * @param message the detail message.
039   */
040  public NonUniqueResultException(String message) {
041    super(message);
042  }
043}