From 0da311e022a512abd542a3b6b09e4ed53e9ebe94 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 11 Apr 2024 17:42:03 +0200 Subject: [PATCH] fix exceptions thrown from JD lifecycle method SS does not do exception translation Signed-off-by: Gavin King --- .../org/hibernate/processor/annotation/LifecycleMethod.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/LifecycleMethod.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/LifecycleMethod.java index 3d319112f2..ba9fd0e073 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/LifecycleMethod.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/LifecycleMethod.java @@ -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,