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
parent afc92451d9
commit 0da311e022
1 changed files with 2 additions and 2 deletions

View File

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