fix exceptions thrown from JD lifecycle method

SS does not do exception translation

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-04-11 17:42:03 +02:00 committed by Christian Beikov
parent cf184bef64
commit 0c6d3595a8
1 changed files with 2 additions and 2 deletions

View File

@ -62,12 +62,12 @@ public class LifecycleMethod extends AbstractAnnotatedMethod {
declaration.append("\t}\n");
if ( operationName.equals("insert") ) {
convertException(declaration,
"jakarta.persistence.EntityExistsException",
"org.hibernate.exception.ConstraintViolationException",
"jakarta.data.exceptions.EntityExistsException");
}
else {
convertException(declaration,
"jakarta.persistence.OptimisticLockException",
"org.hibernate.StaleStateException",
"jakarta.data.exceptions.OptimisticLockingFailureException");
}
convertException(declaration,