Skip to content

Commit

Permalink
Allow nested exceptions on the few PersistenceExceptions subclasses t…
Browse files Browse the repository at this point in the history
…hat currently do not
  • Loading branch information
sebersole authored and lukasj committed Feb 10, 2022
1 parent ace6d3c commit 02502b6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -48,6 +48,14 @@ public EntityNotFoundException() {
super();
}

/**
* Constructs a new <code>EntityNotFoundException</code> exception with
* <code>null</code> as its detail message.
*/
public EntityNotFoundException(Exception cause) {
super(cause);
}

/**
* Constructs a new <code>EntityNotFoundException</code> exception with the
* specified detail message.
Expand All @@ -59,4 +67,15 @@ public EntityNotFoundException(String message) {
super(message);
}

/**
* Constructs a new <code>EntityNotFoundException</code> exception with the
* specified detail message.
*
* @param message
* the detail message.
*/
public EntityNotFoundException(String message, Exception cause) {
super(message, cause);
}

}
37 changes: 27 additions & 10 deletions api/src/main/java/jakarta/persistence/NonUniqueResultException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -31,21 +31,38 @@
*/
public class NonUniqueResultException extends PersistenceException {

/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with <code>null</code> as its detail message.
*/
/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with <code>null</code> as its detail message.
*/
public NonUniqueResultException() {
super();
}

/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with the specified detail message.
* @param message the detail message.
*/
/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with <code>null</code> as its detail message.
*/
public NonUniqueResultException(Exception cause) {
super(cause);
}

/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with the specified detail message.
* @param message the detail message.
*/
public NonUniqueResultException(String message) {
super(message);
}

/**
* Constructs a new <code>NonUniqueResultException</code> exception
* with the specified detail message.
* @param message the detail message.
*/
public NonUniqueResultException(String message, Exception cause) {
super(message, cause);
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -33,6 +33,14 @@ public TransactionRequiredException() {
super();
}

/**
* Constructs a new <code>TransactionRequiredException</code> exception with
* <code>null</code> as its detail message.
*/
public TransactionRequiredException(Exception cause) {
super(cause);
}

/**
* Constructs a new <code>TransactionRequiredException</code> exception with
* the specified detail message.
Expand All @@ -43,4 +51,15 @@ public TransactionRequiredException() {
public TransactionRequiredException(String message) {
super(message);
}

/**
* Constructs a new <code>TransactionRequiredException</code> exception with
* the specified detail message.
*
* @param message
* the detail message.
*/
public TransactionRequiredException(String message, Exception cause) {
super(message, cause);
}
}

0 comments on commit 02502b6

Please sign in to comment.